Reputation: 259
I'm a beginner student working on a project for AX2012
. I have an external PDF file to print . For this,I am looking for a solution to upload, display and then print the PDF from an external file when I click a button.
I have test this job
static void AALpdfprint(Args _args)
{
PrintJobSettings printJobSettings = new PrintJobSettings();
Dialog dialog = new Dialog();
DialogField dialogFileName;
str adobeExe;
str adobeParm;
;
dialogFileName = dialog.addField(extendedTypeStr(Filenameopen), "immatriculation");
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);
}
}
Here i can upload the file correctly, but i want display it before printing.
Upvotes: 1
Views: 1566
Reputation: 18051
Have you tried other command line options to Acrobat reader?
What applies to other languages applies to X++ as well.
Upvotes: 1