AI Is Rewriting Manufacturing - Is Your ERP Ready For What's Next? - 24th April | 10:30 AM Register Now!

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.

File formats you can use:

  • PDF Document Format [.pdf]
  • OpenOffice Documents [.odt, .ott, .odg, .odp, .ods]
  • MS Word Documents [.doc, .docx, .rtf, .txt, .xml]
  • MS PowerPoint Documents [.ppt, .pptx, .pps, .ppsx]
  • MS Excel Documents [.xls, .xlsx, .xlsm]
  • HTML Documents [.htm, .html, .mht, .mhtml]
  • Vector Drawing Formats [.wmf, .emf]
  • Image Formats [.bmp, .jpg, .jpeg, .tif, .tiff, .gif, .png, .pcx]
  • Image Formats [.tga, .jp2, .j2k, .jpc, .jpx, .pbm, .pgm, .ppm, .pnm]

Prerequisite:

Steps to Implement Silent printing from NAV 2016:

  • Download PrintPDF.exe from the above link.
  • 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

  1. To Run PDFPrint tool
  2. Bin code of Printer: this is the Bin Code of Printer by running this command from CMD: pdfprint.exe -listbins -printer “HP LaserJet 1020”
  3. Printer Name
  4. Number of copies that you want to print.
  5. Paper type Code: for A4 size, it is “9”.
  6. This “2” will print duplex (side by side) printing.
  7. This parameter will restore the original printer settings after running this command.
  8. 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.

All Parameters and their usage with examples:

Parameters Usage: pdfprint.exe [options] [Options]
-firstpage first page to print, from 1 to max page
-lastpage last page to print, from 1 to max page
-prompt prompt the user with the print dialog so they can change printer settings and/or select pages manually
-printer printer name to print
-savedevmode prompt the user with print dialog and save the printer settings into a disk file
-loaddevmode restore printer settings which saved by -savedevmode parameter
-promptdevmode prompt the user with print dialog and print the printer settings to screen
-devmode restore printer settings which outputed by -promptdevmode parameter
-copies set number of copies to print
-setcopyto set ‘-copies’ value to printer instead of print it several times
-paper paper size to printer
-shell Call default PDF viewer to print PDF file
-shell2 Call default PDF viewer to print PDF file
-shelltime set timeout for shell printing,in milliseconds
-vector render PDF page to vector EMF before printing
-vectorplus render PDF page to vector EMF with GDIPlus before printing
-vectorgray render PDF page to vector EMF with grayscale before printing
-raster render PDF page to image before printing
-raster2 render PDF page to image before printing
-raster2center center the printout when use -raster2
-raster2aa enable font anti-aliasing: yes/no, default is ‘yes’
-raster2aavec enable vector anti-aliasing: yes/no, default is ‘yes’
-rasterbitcount set bitcount for raster image, e.g., 1, 8, 24
-rasterbwtext disable halftone for color text, for -raster2 only
-enhancethinlines enhance thin lines when render PDF file to image
-preproc process PDF file before printing, useful for some damaged PDF files
-printtofile save print spooling data to a disk file
-mergeprintjobs combine all print jobs into one print job
-listprinter list printers in system
-listbins list bins/trays of a printer
-listjobs list print jobs in printer’s queue
-listall list printers, ports, monitors etc.
-chgbin change bin/tray for printer by number
-papersource change bin/tray for printer by name
-settraytopclfile set tray to PCL file directly, only work when ‘-papersource’ used
-winfont use Windows fonts to instead of embedded fonts
-winfont2 force to use Windows fonts to instead of all embedded fonts
-useembedfont use embedded fonts from PDF file
-useunicode enable or disable unicode conversion for PDF printing
-antifonts enable anti-aliased font bitmaps for emulated fonts
-nochgprinter don’t change default printer during printing
-restoreprinter restore original settings to printer after printing
-printermargins reduce to printer margins when printing
-checkjobstatus check status for print jobs
-checkjobtime delay some time before check status for print jobs, in millisecond
-nodelfailjobs don’t delete failed print jobs
-movetotop move print area to top if printer paper not same as PDF paper, default is ‘center’
-openpassword set open password to PDF file
-ispasswordprotected check if a PDF file protected by ‘open password’ or not
-getpagecount read page count from input PDF file
-jobusername specify the name of the user who owns the print job
-jobdocname specify document name of print job
-ownerservicename specify the name of OwnerService on Windows Server 2008
-useownerservice force to use owner service for all systems
-deleteownerservice remove the OwnerService from Windows
-nup print multiple pages on one sheet, nUP printing
-marginscale scale percent for print margins when printing EMF file, range from 1 to 45
-silent print PDF files silently
-timeout specify a timeout to avoid hanging pdfprint process, in millisecond
-wtext watermark on printed document
-wtype type of watermark
-wf font name of watermark
-wh font height of watermark
-ww font width of watermark
-wb specify bold font
-wi specify an italic font
-wu specify an underlined font
-ws specify a strikeout font
-wo opacity of watermark, from 0 to 100
-wa angle of watermark
-wc color of watermark,
-wx X offset of watermark
-wy Y offset of watermark
-quiet don’t print any message on screen
-debug print out debug messages
-logtofile redirect debug message to a log file
-checkspooler check Windows Spooler Service if running before printing
-clickpopup click ‘Retry’ button on ‘Xerox Printer’ automatically
-watermarkfile a .ini file which contain information for multiple watermarks
-$ Input registration key

Examples:

pdfprint.exe -printer “PDFcamp Printer” -copies 3 -paper 9 C:input.pdf
pdfprint.exe -printer “PDFcamp Printer” -paper “pdf” C:input.pdf
pdfprint.exe -printer “PDFcamp Printer” -paper “11x17in” C:input.pdf
pdfprint.exe -printer “PDFcamp Printer” -paper “215.9×279.4mm” C:input.pdf
pdfprint.exe -printer “PDFcamp Printer” -paper “612x792pt” C:input.pdf
pdfprint.exe -printer “docPrint” -paper “612x792pt” -orient 1 C:input.pdf
pdfprint.exe -printer “docPrint” -paper “612x792pt” -orient 2 C:input.pdf
pdfprint.exe -printer “docPrint” -paper “11x14in” -pdforient 3 C:input.pdf
pdfprint.exe -printer “docPrint” -firstpage 1 -lastpage 1 C:input.pdf
pdfprint.exe -prompt C:input.pdf
pdfprint.exe -firstpage -1 -lastpage -1 C:lastpage.pdf
pdfprint.exe -scalex 50 -scaley 50 C:input.pdf
pdfprint.exe -scalex 0 -scaley 0 C:input.pdf
pdfprint.exe -scalex -1 -scaley -1 C:input.pdf
pdfprint.exe -duplex 3 C:input.pdf
pdfprint.exe -color 1 C:input.pdf
pdfprint.exe -xres 600 -yres 600 C:input.pdf
pdfprint.exe -xres -4 C:input.pdf
pdfprint.exe -xoffset 200 -yoffset 200 C:input.pdf
pdfprint.exe -scale 50 C:input.pdf
pdfprint.exe -shell -shelltime 5000 C:input.pdf
pdfprint.exe -vector C:input.pdf
pdfprint.exe -vector -printermargins -nochgprinter C:input.pdf
pdfprint.exe -raster C:input.pdf
pdfprint.exe -raster2 -rasterbitcount 1 C:input.pdf
pdfprint.exe -raster2 -rasterbwtext -rasterbitcount 1 -xres 600 -yres 600 C:input.pdf
pdfprint.exe -raster2 -raster2center -printermargins C:input.pdf
pdfprint.exe -shell C:input.pdf
pdfprint.exe -shell2 C:input.pdf
pdfprint.exe -preproc C:input.pdf
pdfprint.exe -printermargins C:input.pdf
pdfprint.exe -nochgprinter -printer “docPrint” C:input.pdf
pdfprint.exe -mergeprintjobs -copies 3 C:input.pdf
pdfprint.exe -mergeprintjobs C:*.pdf
pdfprint.exe -mergeprintjobs C:test*.pdf
pdfprint.exe -mergeprintjobs C:files.txt
pdfprint.exe C:files.txt
pdfprint.exe -printtofile C:out.pcl -printer “HP PCL Printer” C:input.pdf
pdfprint.exe -listprinter
pdfprint.exe -listjobs -printer “docPrint”
pdfprint.exe -listall
pdfprint.exe -listbins -printer “docPrint”
pdfprint.exe -chgbin 15 -printer “docPrint” C:input.pdf
pdfprint.exe -papersource “auto” -printer “docPrint” C:input.pdf
pdfprint.exe -papersource “Tray 1” -printer “docPrint” C:input.pdf
pdfprint.exe -papersource “Manual Feed” -printer “docPrint” C:input.pdf
pdfprint.exe -papersource “Media Tray” -printer “docPrint” C:input.pdf
pdfprint.exe -papersource “Tray 3” -settraytopclfile C:test.pcl
pdfprint.exe -getpagecount C:input.pdf
pdfprint.exe -jobusername TestUser C:input.pdf
pdfprint.exe -savedevmode C:file.dat -printer “VeryPDF PCL Writer”
pdfprint.exe -loaddevmode C:file.dat -printer “VeryPDF PCL Writer” C:input.pdf
pdfprint.exe -jobdocname “test.doc” -jobusername “MyName” C:input.pdf
pdfprint.exe -useownerservice -jobdocname “test.doc” -jobusername “MyName” C:input.pdf
pdfprint.exe -winfont -winfont2 C:input.pdf
pdfprint.exe -debug -shell2 -shelltime 1000 -nochgprinter C:input.pdf
pdfprint.exe -debug -logtofile D:debug.log C:input.pdf
pdfprint.exe http://online.verypdf.com/examples/pdfeditor.pdf
Watermark options during printing:
pdfprint.exe -wtext “Watermark” C:input.pdf
pdfprint.exe -wtext “Watermark” -wtype 1 C:input.pdf
pdfprint.exe -wtext “Watermark” -wf “Arial” C:input.pdf
pdfprint.exe -wtext “Watermark” -wh 200 C:input.pdf
pdfprint.exe -wtext “Watermark” -wb -wi -wu -ws C:input.pdf
pdfprint.exe -wtext “Watermark” -wo 80 C:input.pdf
pdfprint.exe -wtext “Watermark” -wo 80 -wa 75 C:input.pdf
pdfprint.exe -wtext “Watermark” -wc “FF0000” C:input.pdf
pdfprint.exe -wtext “Watermark” -wc “00FF00” C:input.pdf
pdfprint.exe -wtext “Watermark” -wc “0000FF” C:input.pdf
pdfprint.exe -wtext “Watermark” -wx 100 -wy 100 C:input.pdf
Print WMF and EMF files with vector information:
pdfprint.exe C:input.wmf
pdfprint.exe C:input.emf
Print Raster Image formats:
pdfprint.exe C:input.bmp
pdfprint.exe C:input.jpg
pdfprint.exe C:input.tif
pdfprint.exe C:input.gif
pdfprint.exe C:input.png
pdfprint.exe C:input.pcx
pdfprint.exe C:input.tga
pdfprint.exe C:input.jp2
pdfprint.exe C:input.j2k
pdfprint.exe C:input.pnm
Print multipage TIFF file format:
pdfprint.exe C:multipage.tif
Print MS Office, TXT, HTML files:
pdfprint.exe C:test.odt
pdfprint.exe C:test.ott
pdfprint.exe C:test.doc
pdfprint.exe C:test.docx
pdfprint.exe C:test.ppt
pdfprint.exe C:test.pptx
pdfprint.exe C:test.pps
pdfprint.exe C:test.ppsx
pdfprint.exe C:test.xls
pdfprint.exe C:test.xlsx
pdfprint.exe C:test.rtf
pdfprint.exe C:test.txt
pdfprint.exe C:test.html
pdfprint.exe C:test.mhtml
pdfprint.exe C:test.xml

In case of any query, feel free to contact us.

About Intech

Intech Systems is a three-cloud Microsoft-certified partner that boasts deep expertise in providing digital transformation solutions for organizations by leveraging the Microsoft 365, Dynamics 365, and Azure solution stack. Intech is recognized as a top-tier Microsoft implementation partner globally and specializes in transformative technology solutions such as ERP (Enterprise Resource Planning), CRM (Customer Relationship Management), Business Process Automation, Business Intelligence, Cloud Infrastructure, Data Management, Productivity & Collaboration and Generative AI (Gen-AI) solutions. As a trusted Microsoft Solutions Partner, we are capable of doing complex technology implementations catered to an organization’s specific needs & also rapid solution implementation such as our Microsoft Dynamics 365 Business Central implementation packages. We pair our implementations with end-to-end customer support, offshore development & 3rd party integrations. With offices in India, USA (United States of America), and Singapore, we work with clients across globe to empower businesses with cutting-edge technology solutions. Our latest services aim at delivering business ready AI solutions to the customer, like our  Microsoft Copilot Consulting Services & Solutions for small, medium & large enterprises. Intech’s expertise lies in building software solutions for Manufacturing, Professional Services & Healthcare.  Our Dealer Management SystemSales and Service CRM for Manufacturing, Field Force Automation for Pharmaceuticals and Manufacturing Central are some of our leading industry solutions. Intech’s vision is to catalyze digital futures for operation-centric industries globally, we are at the forefront of innovation, helping organizations drive growth and innovation like never before. Contact Us to learn more.

About the Author

intech systems

intech systems

Related Posts

In today’s competent business scenes driving your business growth to the next level is notably imperative. This can only be comprehended if the organizations realize that – ‘Customers is the…

  • 12 mins read

An Enterprise Resource Management (ERP) System is an integrated management application that helps to interpret and manage finance, supply chain, manufacturing, project management, and other day-to-day business operations efficiently. An…

  • 15 mins read

A Day in the Life of Customer Service: Sound Familiar? Picture this: It’s 9:05 AM on a Monday. Your team of dedicated Customer Service Representatives is already fielding calls left…

  • 35 mins read
Chat with Neo

Neo

Intech Systems AI Assistant