I would like to silently print PDF files from the hard drive to a named printer, which may or may not be the default printer.

In the this thread, it shows how to silently print the PDF but it always goes to the default printer. Is there a command line that allows the entry of the printer name? Is there a better way to go?

Thanks,

Nitro

Dani AI

Generated

Short practical summary and options (builds on question and the replies from , and ).

If the goal is a reliable, truly headless send-to-printer (not the flaky Acrobat UI or file‑association verbs), choose one of three approaches depending on constraints:

  • Lightweight command-line: SumatraPDF accepts a named printer and silent flags (example: SumatraPDF.exe -print-to "Printer Name" -silent "C:\path\file.pdf"). It is simple to script from VB (ProcessStart) and supports basic print-settings. SumatraPDF command-line docs.

  • Ghostscript (server / advanced): Ghostscript’s mswinpr2 device can print to a named Windows printer via -sOutputFile="%printer%Printer Name" and has options to suppress dialogs — useful where you need PostScript/PDF rendering control. Ghostscript mswinpr2 docs.

  • In‑app printing (recommended for robustness from VB/.NET): render-and-print with a PDF library (PDFium/PdfiumViewer or PdfiumPrinter). Load the PDF, create a PrintDocument, set PrinterSettings.PrinterName, use a StandardPrintController to avoid UI, then call Print() — this gives programmatic control over pages, copies and trays. See the PdfiumViewer project for details and examples. PdfiumViewer (GitHub).

Why not always use Acrobat / ShellExecute? The print/printto verbs and Acrobat Reader command-line have historically been unreliable: behavior varies by version, file association (DDE), and can leave windows or processes open. Use Shell verbs only if you accept those risks. See Microsoft docs on shell verbs and .NET ProcessStartInfo notes for background. Canonical shell verbs / ShellExecute docs · ProcessStartInfo.Verbs.

Caveats: quote exact printer names (UNC for network printers), run under an account that has access to the printer, and avoid attempting interactive Acrobat printing from a Windows service (Session 0 / interactive services restrictions can hide dialogs). Windows service / Session 0 guidance.

Member Avatar for Member #104559

I used the link in your thread to find out how to do the printing but I too would like to print to a specific printer.

I used this command...

?"[FilePrintTo(" & Chr(34) & sPDFPath & Chr(34) & "," & Chr(34) & PrinterName & Chr(34) & "," & Chr(34) & printerDriver & Chr(34) & "," & Chr(34) & PrinterPort & Chr(34) & ")]"

e.g

[FilePrintTo("c:\test.pdf","\\echo\Canon i6500","winspool","Ne02:")]

I found this information on adobe.com...

It does say that this should pop up a modal window (therefore not silent) however this did not happen with me and it allows me to print silently to a named printer

For pdf silent printing we are using CLPrint on

You can easy Print all your PDF documents to any printer you have. You can define the DPI, print range, color mode and many more all from your command prompt.

here is an article how to open and show and silent print pdf in Windows and Mac OSX with examples:

bye
d

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.