Forum moved here!

Home / Can’t print with network printers on command line on Windows Server 2012

sijf

Hello,

We can’t print on Windows Server 2012 when we enter a network printer path on command line.

OS : Windows Server 2012

SumatraPDF version : 3.1.2 64-bit

Command line used : .\SumatraPDF.exe -print-to “\\print-server\LMS - INFORMATIQUE” -exit-on-print “D:\path\_1705040236242489vwvs110609510.pdf”

Remarks :

  • we used SumatraPDF to print on a Windows XP Professional and this command line was working.
  • when we enter the command line, there is no error message
  • if we mount the printer locally, the command line works (but this is not a valid solution for our process because we’ve got many printers).
kjk

I can only suggest trying latest pre-release: https://www.sumatrapdfreader.org/prerelease.html and/or trying 32-bit build vs. 64 bit.

You say that it used to work on XP (which I assume was 32-bit), so it might be 64-bit vs 32-bit issue or it might be a subtle change in how win apis work.

Either way, I don’t have access to the exact setup you have.

The code to Sumatra is open. Printing code is in Print.cpp (PrintFile function) so if you have ability to compile and step through the code and see where exactly does it fail, it would help me figure out the problem.

sijf

Unfortunately, we can not compile the solution (VS2013).

In any case, it seems that we have to mount printers on which we want to print on Windows 7 or higher (on Windows XP we could print on unmounted printers).
We have modified our program to mount unmounted printers and SumatraPDF can print.

So it seems this is not a SumatraPDF issue but a Windows issue

SumatraPeter

Since the major addition after XP is UAC, did you check if running Sumatra as admin on Win7 or higher allows printing on unmounted printers?

sifh

We already tried and it didn’t work even with uac disabled and executing the command line as Admin.

But like my mate said, we found an issue mounting the printer every time an user want to print.

Thanks for you answer

johnp

I found that if you share the printer and use the Share Name then it works with 2012

thomas

Problem here too!
It works on xp 32 win7 32 & 64 but not on w2k12

run as admin or not makes no difference
tested the actual beta’s - did not work

GitHubRulesOK

Think this is related to

GitHubRulesOK
Claudiano74

Hi to All,
I have a problem in my recently project, so let me explain.
I built a site web where the visitors can print some pdf files, with the localhost connect the project it works perfectly and it print in BACKGROUND, but in windows server 2012 don’t print. In the task manager i see sumatrapdf tred that is running but don’t print nothing. I copy the string used for sumatrapdf command and this run if i copy in the cmd windows…
I checked and gave all the execution permissions to sumatrapdf.
I don’t Know… can someone help me please?
Sorry for my terrible English.

thank you very much

GitHubRulesOK

Hi @Claudiano74 I have moved your query here as it is related to the problems experienced by other users perhaps some of the above comments may help.

Claudiano74

thanks a lot, now I read

Claudiano74

I thank you very much but I could not solve … that of printing one or more files in the background is a very convenient feature and I think it is very common, can anyone have solved it in a simple way ???