PDF with signature, watermarks, letterhead, and merging

jacobreinholdtjacobreinholdt Member Posts: 9
Hi!

I am writing this post to help all the NAV developers out there that uses the BioPDF or Bullzip PDF Printer to create advanced PDF documents from NAV reports. Many of you have written to me in the past to get help with PDF creation in NAV. Finally, I have created an example to illustrate how to work with the Bullzip PDF Printer from NAV.

The example will show you how to:
(*) Control a loop where multiple documents are created. This is about flow control and error handling. Also making sure that the right PDF settings goes to the right print job.
(*) Signing a PDF with a digital certificate.
(*) Writing on top of another PDF as a letterhead.
(*) Merging with other PDF documents.
(*) Printing without showing dialogs.

All this is published at http://www.bullzip.com/products/pdf/doc ... s/info.php

Please note that this example uses the version that is currently in beta. Until it is publicly released, it can be downloaded here:

http://www.bullzip.com/products/pdf/beta.php

You are welcome to post me questions here or use the contact form on my web site :)

Best regards,
Jacob

Comments

  • gensmanngensmann Member Posts: 24
    Hi Jacob,

    Thanks for the write-up, I find your pdf-software very useful.

    I have not tried to implement your example, but looking at the code, it seems you assume that the default printer on the system is the pdf-printer or that it's set up as the printer for report 206 in the Printer Selection table.

    I've found it useful to make sure there's a record in the Printer Selection table for the report being used and the user executing the code to ensure that the correct printer is used.

    Something like this works:
    PrinterSelection.SETRANGE("User ID",USERID);
    PrinterSelection.SETRANGE("Report ID",ReportID); //ReportID is passed as a parameter to the function
    
    IF PrinterSelection.FINDFIRST THEN BEGIN //There's already a printer setup, we back it up
      TempPrinterSelection := PrinterSelection;
      TempPrinterSelection.INSERT;
      PrinterSelection.DELETE;
    END;
    
    CLEAR(PrinterSelection);
    PrinterSelection.init;
    PrinterSelection."User ID" := USERID;
    PrinterSelection."Report ID" := ReportID;
    Printer.SETRANGE(Name,'Bullzip PDF Printer'); //Perhaps this should be changed to use your pdfUtil.DefaultPrinterName
    IF Printer.FIND('=<>') THEN
      PrinterSelection."Printer Name" := Printer.ID
    ELSE
      ERROR(T001,'Bullzip PDF Printer'); //T001 = 'The printer %1 is not available.\\Please contact ...'
    PrinterSelection.INSERT;
    

    PS. The Printer Selection table is also mentioned in one of the NAV design patterns published on Dec 19th, great work towards standardized approaches to customization and add-ons.


    Thanks and happy holidays,
    Best regards Poul Anker Gensmann
    http://www.gbusiness-solutions.com
  • jacobreinholdtjacobreinholdt Member Posts: 9
    Thank you for your comment on the printer selection :)

    /Jacob
Sign In or Register to comment.