Saturday, April 1, 2017

Silent Printing from Dynamics NAV (Multiple Tray, Dual Side, Watermark Print, etc)

Hello Friends,

As you know it is not possible in NAV to have advance printing option like merge 2 document and print in single call with source page from multiple tray & dual side printing.

We have make it possible very easily with Dynamics NAV (by just single click only)

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:

ParametersUsage: pdfprint.exe [options] [Options] <PDF Files>
-firstpage <int>first page to print, from 1 to max page
-lastpage <int>last page to print, from 1 to max page
-promptprompt the user with the print dialog so they can change printer settings and/or select pages manually
-printer <string>printer name to print
-savedevmode <string>prompt the user with print dialog and save the printer settings into a disk file
-loaddevmode <string>restore printer settings which saved by -savedevmode parameter
-promptdevmodeprompt the user with print dialog and print the printer settings to screen
-devmode <string>restore printer settings which outputed by -promptdevmode parameter
-copies <int>set number of copies to print
-setcopytoset ‘-copies’ value to printer instead of print it several times
-paper <string>paper size to printer
-shellCall default PDF viewer to print PDF file
-shell2Call default PDF viewer to print PDF file
-shelltime <int>set timeout for shell printing,in milliseconds
-vectorrender PDF page to vector EMF before printing
-vectorplusrender PDF page to vector EMF with GDIPlus before printing
-vectorgrayrender PDF page to vector EMF with grayscale before printing
-rasterrender PDF page to image before printing
-raster2render PDF page to image before printing
-raster2centercenter the printout when use -raster2
-raster2aa <string>enable font anti-aliasing: yes/no, default is ‘yes’
-raster2aavec <string>enable vector anti-aliasing: yes/no, default is ‘yes’
-rasterbitcount <int>set bitcount for raster image, e.g., 1, 8, 24
-rasterbwtextdisable halftone for color text, for -raster2 only
-enhancethinlinesenhance thin lines when render PDF file to image
-preprocprocess PDF file before printing, useful for some damaged PDF files
-printtofile <string>save print spooling data to a disk file
-mergeprintjobscombine all print jobs into one print job
-listprinterlist printers in system
-listbinslist bins/trays of a printer
-listjobslist print jobs in printer’s queue
-listalllist printers, ports, monitors etc.
-chgbin <int>change bin/tray for printer by number
-papersource <string>change bin/tray for printer by name
-settraytopclfile <string>set tray to PCL file directly, only work when ‘-papersource’ used
-winfontuse Windows fonts to instead of embedded fonts
-winfont2force to use Windows fonts to instead of all embedded fonts
-useembedfontuse embedded fonts from PDF file
-useunicode <int>enable or disable unicode conversion for PDF printing
-antifontsenable anti-aliased font bitmaps for emulated fonts
-nochgprinterdon’t change default printer during printing
-restoreprinterrestore original settings to printer after printing
-printermarginsreduce to printer margins when printing
-checkjobstatuscheck status for print jobs
-checkjobtime <int>delay some time before check status for print jobs, in millisecond
-nodelfailjobsdon’t delete failed print jobs
-movetotopmove print area to top if printer paper not same as PDF paper, default is ‘center’
-openpassword <string>set open password to PDF file
-ispasswordprotectedcheck if a PDF file protected by ‘open password’ or not
-getpagecountread page count from input PDF file
-jobusername <string>specify the name of the user who owns the print job
-jobdocname <string>specify document name of print job
-ownerservicename <string>specify the name of OwnerService on Windows Server 2008
-useownerserviceforce to use owner service for all systems
-deleteownerservice <string>remove the OwnerService from Windows
-nup <int>print multiple pages on one sheet, nUP printing
-marginscale <string>scale percent for print margins when printing EMF file, range from 1 to 45
-silentprint PDF files silently
-timeout <int>specify a timeout to avoid hanging pdfprint process, in millisecond
-wtext <string>watermark on printed document
-wtype <int>type of watermark
-wf <string>font name of watermark
-wh <int>font height of watermark
-ww <int>font width of watermark
-wbspecify bold font
-wispecify an italic font
-wuspecify an underlined font
-wsspecify a strikeout font
-wo <int>opacity of watermark, from 0 to 100
-wa <int>angle of watermark
-wc <string>color of watermark,
-wx <int>X offset of watermark
-wy <int>Y offset of watermark
-quietdon’t print any message on screen
-debugprint out debug messages
-logtofile <string>redirect debug message to a log file
-checkspoolercheck Windows Spooler Service if running before printing
-clickpopupclick ‘Retry’ button on ‘Xerox Printer’ automatically
-watermarkfile <string>a .ini file which contain information for multiple watermarks
-$ <string>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
I hope it will help you in future.

You can download the source setup files & NAV sample object from following link (ask for password)
https://1drv.ms/u/s!An8nhANnLJmtiU19GK_ASfdxxxQM

Thank you for reading.

Keep Sharing...Keep Growing...

Sunday, March 19, 2017

Direction Asia 2017 - 23 & 24 March @ Bangkok

Hello Friends,

I am going to attain Direction Asia 2017 event at Bangkok 23-24 March.

The Directions conference in US and EMEA have been growing over the years - join this first Directions conference in ASIA ?
The Directions ASIA conference is  a must-attend event for any NAV person.
Now, you can already save the date for Directions ASIA 2017, which will be held on March 23 - 24 in Bangkok, Thailand.
Join your peers there to get ready for NAV2017, network and learn from other NAV people of the NAV focused event !!!

Location
Hilton Millenium
123, Charoen Nakhon Rd, Khlong Ton Sai, Khlong San, Bangkok 10600, Thailanda





















Following are the schedule that we will learn and i will share the related document and workshop soon.

Following are list of trailing/workshop topic for Technical Consultant
• DYNAMICS NAV 2017 EXTENSIONS AND EVENTS, AN OVERVIEW
• DYNAMICS NAV 2017, EXTENSIONS AND EVENTS, PRACTICAL EXAMPLES
• DYNAMICS NAV 2017, EMBEDDED POWER BI
• USING DESIGN PATTERNS IN PRACTICE
• DYNAMICS NAV 2017, EXTENSIONS - HANDS ON 
• DYNAMICS NAV2017, MODERN DEVELOPMENT EXPERIENCE AND IMPROVEMENT FOR DEVELOPERS
• BAD HABITS OF NAV DEVELOPERS
• DYNAMICS NAV 2017, IN OFFICE 365 EXPERIENCE
• DYNAMICS NAV 2017, DYNAMICS 365 FOR SALES INTEGRATION AND IMPROVEMENT TO CRM IN NAV
• DYNAMICS NAV 2017, USING EVENTS
• DYNAMICS 365 FOR FINANCIALS APPS, APPSOURCE & SOLUTIONAPPS
• SOURCE CONTROL
• DESIGN PATTERNS
• INTEGRATION / CONTROL EVENTS
• DYNAMICS NAV 2017, EXTENSIONS - AN INTERACTIVE DISCUSSION


Following are list of trailing/workshop topic for Functional Consultant:
• DYNAMICS NAV2017, APPLICATION ENHANCEMENTS
• Dynamics NAV 2017, User Experience Improvements
• DYNAMICS NAV 2017, APPLICATION IMPROVEMENTS IN FINANCIALS AND JOBS
• DYNAMICS NAV 2017, EMBEDDED POWER BI
• DYNAMICS 365 FOR FINANCIALS, THE BUSINESS OVERVIEW
• DYNAMICS NAV2017 NOTIFICATIONS
• DYNAMICS NAV 2017, APPLICATION IMPROVEMENTS - HANDS ON
• DYNAMICS 365 FOR SALES, THE BUSINESS OVERVIEW
• DYNAMICS 365, BUSINESS EDITION PRICING AND LICENSING, INTRODUCTION
• DYNAMICS NAV2017 CORTANA INTELLIGENCE
• DYNAMICS NAV 2017, IN OFFICE 365 EXPERIENCE
• DYNAMICS NAV2017, DEMOS
• DYNAMICS NAV 2017, EMBEDDED POWER BI - HANDS ON
• STRATEGY Q&A WITH DYNAMICS SMB LEADERSHIP TEAM

Saturday, March 18, 2017

Change the Date Format in NAV 2016 Web Client to DD/MM/YYYY & Currency to Indian Format

Hello Friends,

This article explains how to change the date format in Microsoft Dynamics NAV web client.
I have tested this on Microsoft Dynamics NAV 2016

A Brief History - 
1. Microsoft Dynamics Windows Client supports the date format as per Client System Date Format. 

2. Server Processes Like NAS and Web services support Date Format as per Defined in the service tier.

But Navision web client does not correspond to either of these two settings for date format.
Show the date in default English US format as following:






















For NAV 2016 Web Client you can configure the Indian Date & Currency format from My Setting in web client.

Steps to configure date format in web client:
---------------------------------------------------------------

1) Login to your web client NAV 2016

2) GoTo MySetting option (Top Left Corner)




























3) Change the Region to "English (India)"































4) Sing Out & Log In again. It will now show you DD-MM-YYYY format






















========================================================================
Same way if you want to change date format + currency format in web service & NAS than you can configure it from NAV Service as following.

Issue is that system showing date in (mm-dd-yyyy) & currency in US format when it is run from web client or NAS Job Queue:













Default it is shows in US format because Service Language Default Set to (en-US)


















Now just change the Service Language value to (en-IN) and restart the service
Service Default Time Zone = India Standard Time

















Now the date format & currency format come to Indian format in reports (run from NAS & Web Client)











That's it.
Done

I hope it will help to some one.
Thank you for reading.

Keep Sharing....Keep Growing....

Wednesday, March 15, 2017

Archive NAV Version Download Link (NAV 1.0 to NAV 2009R2 All Version)

Hello Friends,

Many time we need to download any old version of NAV for upgrade estimate or other reason and it is very difficult for search it on Partner Source account.

So, that i want to share the link of partner source page where you can find all detail about old version and download link for that.


​This page includes databases for Navision Financials 1.00 through Microsoft Dynamics NAV 2009 R2. The databases can be used in the upgrade process to upgrade earlier versions of Microsoft Dynamics NAV to the latest version of Microsoft Dynamics NAV

https://mbs.microsoft.com/partnersource/northamerica/deployment/downloads/service-packs/databasearchiveformicrosoftnavisionna



























I hope it will be helpful for someone.

Thank you for reading.

Keep Sharing...Keep Growing...