Here is the new concept of Silent Printing from Dynamics NAV. Silent Printing will help you to print from NAV without any user interaction (Page setup, Side by side Printing, Page selection, color settings, Tray Selections).
This will reduce the time to set printing preferences every time.
Keep this tool in Network Shared Drive, so that NAV can access it.
Prepare Codeunit in NAV to run this tool from NAV.
As this tool is command based, you can run this from CMD(Command Prompt). From NAV you can run CMD by creating .Net Assembly variable(‘Windows Script Host Object Model’.WshShell) By creating above variable, you can run CMD from NAV itself.
Now Prepare a command that will run to do side by side printing.
Explanation of each parameter of the above sample command for Side by Side printing
To Run PDFPrint tool
Bin code of Printer: this is the Bin Code of Printer by running this command from CMD: pdfprint.exe -listbins -printer “HP LaserJet 1020”
Number of copies that you want to print.
Paper type Code: for A4 size, it is “9”.
This “2” will print duplex (side by side) printing.
This parameter will restore the original printer settings after running this command.
Your File Name that you want to print
To test this command whether it is working or not, you can run directly from CMD prompt.
Now prepare this command in NAV by creating Text Constant:
Create a function that runs CMD from NAV.
Now replace CMDcmd_itxt variable with your newly created Text constant Text50001_gCtx.
Now run this function. It will print the Test.pdf document without any User Interaction dialog as you defined in command.