Ahmed
Ahmed

Reputation: 259

Ax2012:How can I upload and print an external PDF file

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

Answers (1)

Jan B. Kjeldsen
Jan B. Kjeldsen

Reputation: 18051

Have you tried other command line options to Acrobat reader?

What applies to other languages applies to X++ as well.

Upvotes: 1

Related Questions