Forum moved here!

Home / Is there a way to create a log with the -silent switch?

HFH

Im currently using SumatraPDF to print PDF files from a Windows Service. For that reason the argument -silent is used.

For some odd reason starting today the server running the service (or something on said server) has started to block SumatraPDF from printing or something… The process just hangs and never stops. I currently have to monitor the process and if it has not stopped by itself after some time I haveto kill it. I realize this is most likely a problem with the server the code is running on but it would be nice to have a log file somewhere that describes how far SumatraPDF actually gets before it is blocked. Maybe it could help at tracing what is currently making the process just hang forever.

GitHubRulesOK

Odd that you report a new problem soon after another user has reported fresh issues, thus I have to wonder is it coincidence or has MS rolled out a broken update?

I (not a developer) do not know how background logging works so can only suggest remove -silent to see if a more verbose error message is raised, such as the freshly raised CLI Error message - Could not obtain Printer properties - intermittent
The instructions to “Debugging a hang” are at https://www.sumatrapdfreader.org/docs/Debugging-Sumatra.html but I have not used those to know if / how well they work.

It is possible to loop past the errorlevel to either re-attempt same print on a delay or move onto next file/call in the hope it is only one filetype or a temporary comms failure. but again not sure how that works if -silent is involved.

As to fresh cause on a previously working system only you could give pointers, such as How has the server usage had some change since last time working well?
Consider system update / new printer / printer driver / change in other users access to any printer especially resetting of any default parameters.

HFH

I cannot currently remove the -silent switch. The code is running as a WIndows Service under localSystem user context and that user does not have a desktop session and cannot prompt user interfaces. Problem is if I open SumatraPDF.exe in an administrative context with UI and open a failed document and send it to the printer it seems to print successfully. So I fear that this is a combination of the system our service is running on and maybe as you suggest a windows update.
Its currently running on a Windows Server 2012 which is old but it is not managed by me so cannot say if updates were just installed on it.

I may have to develop interaction with Adobe Reader too and see if I can solve it with that instead.

HFH

Still interested in an ability to add a -log “PATHTOLOGFILE” to be able to inspect why SumatraPDF sometimes will not print.

It seems like a local problem because restarting the server makes the documents print if queued again but would be a good way to be able to trace the problem on the server in the future if I could tell SumatraPDF.exe to post log messages to a log file.

GitHubRulesOK

Your need is specifically a debugging feature (which the developer may be able to help with, BUT …) You would need to raise as an “Issue” @ GitHub-SumatraPDF

HFH

I will do that. This is especially important with using the -silent switch. I’ll try to raise the issue on Github.

Thank you.

HFH

Just wanted to share. Unable to find to old Github case to update progress but we finally convinced our customer to try different hardware. So we got a new server and currently Sumantra has printed 1281 documents without blocking. 1281 may not sound like much but before on the old hardware we were never went past the 300 mark before server had to be restarted.

GitHubRulesOK

Thanks for the feedback.

You may have seen that printing in general (not just SumatraPDF) but especially server / networked users was impacted by March MS updates so beware the kb numbers of updates.
But if using new kit I would guess it is all up to date.

A potential problem to in future affect printing of ePS could arise if installed / updated GhostScript is version 9.54 or above. see Ghostscript not working -- "Error loading ..." on .ps files - #2 by GitHubRulesOK