static void pdfprint(Args _args)
{
PrintJobSettings printJobSettings = new PrintJobSettings();
Dialog dialog = new Dialog();
DialogField dialogFileName;
str adobeExe;
str adobeParm;
;
dialogFilename = dialog.addField(typeid(FilenameOpen));
if (dialog.run())
{
printJobSettings.printerSettings('SysPrintForm');
adobeExe = WinAPI::findExecutable(dialogFileName.value());
adobeParm = strFmt(' /t "%1" "%2" "%3" "%4"',
dialogFileName.value(),
printJobSettings.printerPrinterName(),
printJobSettings.printerDriverName(),
printJobSettings.printerPortName());
winAPI::shellExecute(adobeExe, adobeParm);
}
}
A blog about any interesting "Microsoft Dynamics AX" and "Microsoft Dynamics 365 for Finance and Operations" stuff I come across.
Monday, January 14, 2008
Print PDF files from AX to specific printer
This job illustrates how you can print an external PDF file to a printer choosen in AX:
Subscribe to:
Post Comments (Atom)
4 comments:
Palle,
This is a perfect article I was just havind this problem!
Keep up blogging ;-)
Philippe Vanstipelen
Edan Business software
Things can be so easy...
Great!
Thomas.
How can you get rid of the prompt dialog box and just directly print the pdf?
It seems like the Foxit Reader is able to print PDF much faster, via the command line, than Adobe Reader:
http://www.bincsoft.com/articles/background-printing-of-pdf-documents/
Post a Comment