I am trying to print a PDF using powershell and AcroRd32.exe and now run into a problem I can't solve by myself. If I am executing the code and Acrobat Reader opens but no print job is generated. I can even see my pdf in the latest use files.
This is my code:
$file = "C:\temp\file.pdf"
$adobe = "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
$driver = "HP Universal Printing PCL 6"
$port = "10.200.1.63:3910"
$printer = "\\pserver\printer07"
$arglist = "/s /t $($file) $($printer) $($driver) $($port)"
Start-Process $adobe -argumentlist $arglist -wait
I tried the following:
- Checking if the file I am trying to print exists and is accessible [YES]
- Tried to print with dialog: argument "-p $($filename) [WORKS]
- Checked if the printer is accessible by the computer [YES]
- Double checked printername, driver and port... [YES]
Even without driver and port I am not able to print a file through this code.
Does anyone have useful tips or suggestions to solve this problem?