How to automatically print pdfs with detailed options? How to automatically print pdfs with detailed options? powershell powershell

How to automatically print pdfs with detailed options?


You could easily make this with Adobe API via COM object.

Here is an exampe of printing pages range:

# path to PDF file$PDF = 'C:\Users\Kiril\Downloads\file.pdf'# declare a COM object for the Acrobat application$App = New-Object -ComObject AcroExch.App# declare a COM object for PDDoc$PDDoc = New-Object -ComObject AcroExch.PDDoc# open a PDF$PDDoc.Open($PDF)# get the number of pages in the pdf document$NumPages = $PDDoc.GetNumPages()# this hides the acrobat instance if it's visible$App.Hide()# this displays the document in the acrobat instance and creates an AVDoc COM object$AVDoc = $PDDoc.OpenAVDoc("")# printing particular pages range$AVDoc.PrintPages(0, 1, $NumPages - 1, 0, 0)

The method PrintPages of $AVDoc object is well described on reference document.

Please see Acrobat® and PDF Library API Reference


You could try to use some 3rd party solution in that scenario, for example, Google Cloud Print or similar


I realize this is an older question, but itextsharp is an addon you can get to read pdf files inside powershell etc...