Forum moved here!

Home / Node calls SumatraPDF.exe and prompts that it cannot be printed

sujiewen

return error code: {“killed”:false,“code”:1,“signal”:null,“cmd”:“c:\Users\Administrator\Documents\wmswarehouse\dist_electron\SumatraPDF.exe -print-to “Brother MFC-7880DN Printer” -print-settings “19x” -silent C:\Users\Administrator\AppData\Roaming\wmswarehouse\Cache\printSvguwx20d0.png”}

I did this, what’s the problem? Thank you!

GitHubRulesOK

I suggest to ensure you try only 2 copies first as a standard user, without -silent then you should see more of the reason for any error.
i.e

That part looks wrong, none of my many printers include “Printer” since most just use their brand/model name without the need to say what they are.

It could be anything e.g. SumatraPDF was not accessible to the user or the png file is not specified correctly, or the printer moniker is incorrect or the quotes are not plain doubles" or the printer does not have enough memory or there was a comms / UAC problem. If SumatraPDF is included as part of a wider WM System then there may be user rights issues, outside its control.

Try running just the simplified command from a console prompt to isolate if it is SumatraPDF or Electron/Node that is the cause of the error. So double check the printer moniker and amend the following if necessary to test for two pages.

cmd
>
C:\Users\Administrator\Documents\wmswarehouse\dist_electron\SumatraPDF.exe -print-to "Brother MFC-7880DN Printer" -print-settings "2x" C:\Users\Administrator\AppData\Roaming\wmswarehouse\Cache\printSvguwx20d0.png
sujiewen

The terminal execution command is OK, and later I found that the node call cannot add double quotes to the printer name