You cannot create an automation object BullZipPDF on microso

elegeantelegeant Member Posts: 7
edited 2014-06-10 in NAV Three Tier
Hi

I am getting the error message 'You cannot create an automation object BullZipPDF on Microsoft Dynamic Nav Server . You must create it on a client computer. This is obtained when using the following on a report which is printing sales invoice to PDF. This code is working fine on Nav 2009 R2 but not on Nav 2013. Please help.

IF ISCLEAR(BullZipPDF) THEN
CREATE(BullZipPDF);

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    You should use CREATE(BullZipPDF, TRUE, TRUE);

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Rob_HansenRob_Hansen Member Posts: 296
    The better approach here would be to update your code to use the Bullzip.PdfWriter .net library rather than COM automation. Then you'll have the option of executing PDF creation logic server-side if you need to (eg. a process running on the NAS).

    The other question here is whether you still need to use the Bullzip PDF writer. Does the native SAVEASPDF not work for some reason?
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    What a conincidence, I am doing the same, upgrading a BullZip based invoice emailing customization :) Basically forget it - do a SAVEASPDF and then mail it with the SMTP Mail Codeunit.

    Although it is weird that for me the old solution had a "merge" and a "superimpose" BullZip commands with two static PDF files. I am trying to figure out what that does... because the finished result looks exactly like the normal invoice report so I don't even get what is the point of that.
  • tinoruijstinoruijs Member Posts: 1,226
    What Miklos said is better.
    I also stopped using PDFCreator in NAV 2013 R2 and now use SAVEASPDF.
    After SAVEASPDF I use pdftk for merging with a pdf for background.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Can you please explain this merging stuff? I am migrating a BullZip based thing that has this merging but I have no idea what it is actually for or even why. What is pdftk and why is this merging useful?
  • tinoruijstinoruijs Member Posts: 1,226
    I use pdftk for merging the digital writing paper (with logo and company information) with documents from NAV.
    This week I'm going to use it for adding an extra page after a NAV-document.
    More info on pdftk: http://en.wikipedia.org/wiki/Pdftk
    And pdftk is also mentioned one or two times on mibuso.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • mdPartnerNLmdPartnerNL Member Posts: 802
    Could you show a simple NAV code sample how you use this? in Classic and in RTC
  • tinoruijstinoruijs Member Posts: 1,226
    Could you show a simple NAV code sample how you use this? in Classic and in RTC
    TextCMDLine := 'F:\pdf\pdftk.exe' + ' ' +
                   PDF1 + ' ' +
                   'background' + ' ' +
                   PDF2 + ' ' +
                   'output' + ' ' +
                   PDFMergedWithBackground;
    
    FileToWrite.CREATE(BatFileNameTxtServer);
    FileToWrite.TEXTMODE(TRUE);
    FileToWrite.WRITE('@ECHO OFF');
    FileToWrite.WRITE(TextCMDLine);
    FileToWrite.WRITE('@ECHO OFF');
    FileToWrite.CLOSE;
    

    Execute the batchfile.
    And use SLEEP before you use the merged pdf.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • tinoruijstinoruijs Member Posts: 1,226
    In addition;
    I've created a batchfile in which I call pdftk.exe three times. I had to build in a "TIMEOUT /T 1" for a sleep of one second between the pdftk.exe-lines.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • davmac1davmac1 Member Posts: 1,283
    Another idea (which I got from an ara3n post on Mibuso which I cannot find) is to wait until the file exists:
              REPORT.SAVEASPDF(ReportSelection."Report ID",
                               InvoiceFile,
                               SIH);
     
              WHILE NOT SETSTAMP(InvoiceFile,TODAY,TIME) DO
    

    This has worked out well for me.
Sign In or Register to comment.