Print PDF from VBscript or command line without acrobat.exe

Brian McGinity picture Brian McGinity · Oct 23, 2013 · Viewed 17.7k times · Source

Is it possible to print a pdf document to the default printer inside of vbscript or from the command line without AcroRd32.exe?

Ideally if would be nice to just send the pdf to printer and not need another program.

  • or -

Is there a 3rd party .exe program which can print the pdf without a dialogue and without opening and without showing in the Windows taskbar?

The .exe needs to be standalone (so a windows install process is not required).

I am ok paying up to $100 for the .exe as long as it can be distributed inside of another application. Free is also great.

This has me stumped.

Answer

Ansgar Wiechers picture Ansgar Wiechers · Oct 23, 2013

I don't think you can print PDFs with VBScript alone. However, SumatraPDF should be able to do what you want. It's a standalone executable and you can print PDFs to the default printer using the -print-to-default option:

filename = "C:\path\to\some.pdf"

Set sh = CreateObject("WScript.Shell")
sh.Run "sumatrapdf.exe -print-to-default """ & filename & """", 0, True

See the manual for more details.