I've searched the forums, but I've been unable to find the answer.
How can I print a pdf file using code only?
My script checks email, downloads attachments, renames the attachment, and if it is from a specific city, it prints the email attachment (pdf); however, I can't get it to send the pdf to the printer.
I've tried a few things, but they haven't worked.
Send file (PDF) to printer
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1385
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Send file (PDF) to printer
My research suggests you can do this with Powershell, and for this solution you need Acrobat Reader to be installed. I tested this and it successfully printed to my default printer.
Code: Select all
Let>PDFFile=D:\MJT\IN\10036659565.pdf
LabelToVar>pscode7,ps
let>RP_WINDOWMODE=0
Run>powershell.exe %ps%
/*
pscode7:
Start-Process \"C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe\" -ArgumentList "/n", "/t", \"%PDFFile%\"
*/
Yes, we have a Custom Scripting Service. Message me or go here