Print PDF from Network Share

Wisa123Wisa123 Member Posts: 308
edited 2016-12-28 in NAV Three Tier
Hi fellow NAV Devs,

I am currently trying to get the following task done:
A PDF is stored on a network share. (not a NAV report, but created by a 3rd party WebService). The PDF needs to printed after a certain operation in NAV is done, and it needs to be printed on the users DefaultPrinter.

Since NAV does not support automated printing of Documents outside of it's own Reports, i have to look out for another solution.
I already invested some hours trying to get it to work using DotNet, however no luck yet.

Things I already tried:
-> Starting another Process via System.Diagnostics
However using this the Adobe Window Pops up on every PDF i try to print. This is a bug in AdobeReader, which Adobe does not care about in the slightest.
https://forums.adobe.com/thread/1042132
-> I also started looking into some really dirty workarounds involving reading the pdf binaries and somehow making them work in RDLC

I am aware that this would be possible using GhostScript and other free libraries. Only downside to this is that I would have to roll out the DLL's to (a lot of) clients, and would prefer not having to do this if there is any other solution. (NAV 2013)

Looking forward to your ideas!

TLDR: How to perform a "silent" print of a PDF from NAV without disturbing the user, or rolling out extra DLL's to the client.
Austrian NAV/BC Dev

Answers

  • pjotresztickpjotresztick Member Posts: 8
    Possibly this blog from Waldo helps you further: http://www.waldo.be/2015/12/21/print-any-document-any-extension
  • Wisa123Wisa123 Member Posts: 308
    Hi pjotresztick,

    Thanks for your answer. What Waldo is describing is 100% how already tried it (System.Diagnostics.Process) - without knowing Waldo blogged about this.

    But this technique uses the clients standard Program for the given file extension (.pdf) to perform the printing - which is sadly AdobeReader in most cases.

    Like described in my link to the Thread in the Adobe Forum, this is a bug in Adobes application, which they won't fix.

    Still open to any new ideas to fix this problem! Suggestions welcome.
    Austrian NAV/BC Dev
  • kylehardinkylehardin Member Posts: 257
    Maybe try another PDF reader like Nitro. There might even be a free one that can be called directly because it exposes dotnet methods (Nitro doesn't look like it does).
    Kyle Hardin - ArcherPoint
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    edited 2017-01-04
    Hi Wisa123,

    There is an alternative reporting solution for NAV. The company is called ForNAV. The solution they proposed can replace, or supplement NAV standard printing.

    The solution is based on custom .NET developed by the company, which renders the report into a PDF file on the NST, and sends the PDF to the client and prints it. From NAV point of view the report is just 'a normal' NAV report - you can print it, save as PDF/Excel etc, schedule printing

    A part of the solution is BullZip pdf printer, which is tightly integrated, and many of BullZip printer features are available in NAV through the company's .NET Add-On. One of the features includes overprinting existing PDFs (merging the actual report output with another PDF file, which location is supplied via a simple line of code.

    You could try to create blank report, modify its code to print it over your pdf, and configure your printing to print 2 reports one ofter another.

    I am just about to try this myself as I have similar problem to solve - a Purchase Invoice which needs to be printed together with terms and conditions document, supplied by another dept in a PDF stored on a network share :)

    Regards
    Slawek

    <EDIT> Since the solution is in form of NAV add-on you don't have to roll out any dll's onto customers PCs yourselves. You install it only once on the NST box, and NAV will distribute required dll for you

    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • MakeItEasyMakeItEasy Member Posts: 1
    Hi,

    I used this one and it worked fine.
    http://www.glyphandcog.com/XpdfPrint.html

    Regards,
    Teo
    *****MakeItEasy*****
Sign In or Register to comment.