Print External PDF file from AX
This job illustrates how we can print an external PDF file to a printer chosen in AX through X++ code. Here a code sample (X++ job) to do this.
static void theAxapta_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);
}
}
Iace Technologies & Services....!!!
Great Post. I just want to share this site PDFFiller, Inc which I use to eSign my documents. I can also get third party digital signatures from my employees and clients. You can get a free trial if you ask for it http://goo.gl/SA1pfw
ReplyDelete