Merge PDF files

gorgavelgorgavel Member Posts: 15
edited 2015-04-08 in NAV Three Tier
I am trying to merge two files (in1 and in2) and create a new file (ut1=outfile) and I have NO luck.
Se coding example and error message below.

Is there anyone who had success with the Merge function in Bullzip.PdfWriter?

// test
in1 := 'C:\Faktura1.pdf';
in2 := 'C:\default2.pdf';
ut1 := 'C:\Faktura2.pdf';
Datetime := 2000;
Printer := Pdfmerge.DefaultPrinterName();
ComPdfSet := ComPdfSet.ComPdfSettings;
ComPdfSet.SetValue('MergeFile', in1 + '|' + in2);
filin := filin.UploadUtility;
PDFInstans := Pdfmerge.PdfUtil();
Pdfmerge.Merge(ComPdfSet,ut1,Printer,Datetime);

Variables
Pdfmerge DotNet Bullzip.PdfWriter.PdfUtil.'Bullzip.PdfWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=041d71cacb6e853c'
in1 Text 30
in2 Text 30
ut1 Text 30
Printer Text 30
Datetime Integer
PdfSet DotNet Bullzip.PdfWriter.PdfSettings.'Bullzip.PdfWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=041d71cacb6e853c'
ComPdfSet DotNet Bullzip.PdfWriter.ComPdfSettings.'Bullzip.PdfWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=041d71cacb6e853c'
Compdfutil DotNet Bullzip.PdfWriter.ComPdfUtil.'Bullzip.PdfWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=041d71cacb6e853c'
infiles DotNet System.String.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
filin DotNet Bullzip.PdfWriter.UploadUtility.'Bullzip.PdfWriter.Upload, Version=1.0.0.0, Culture=neutral, PublicKeyToken=439886f61986a3e4'
filut File
PDFInstans DotNet Bullzip.PdfWriter.PdfUtil.'Bullzip.PdfWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=041d71cacb6e853c'

Error text: A call to Bullzip.PdfWriter.PdfUtil.Merge failed with this message; The type of one or more arguments does not match the method's parameter type.

Help wanted!

NAV Version 2013.

Rgds
Goran

Comments

  • TonyDuarteTonyDuarte Member Posts: 92
    Think you need this
    // Merge with other PDF files.
        pdfSettings.SetValue('MergeFile', mergeBeforeFileName + '|.|' + mergeAfterFileName);
    

    The information is on the pdf printer website...

    http://www.bullzip.com/products/pdf/doc/examples/dynamics-nav-invoices/info.php

    Check the sample code and see what might be missing
  • vic_wellervic_weller Member Posts: 1
    It looks like the solution provided is almost legit, but it merges two documents with a blank page between them. And it's like the common thing, vast interface-based PDF editors do so in that fashion as well and I don't know why does anybody still figured out this is not supposed to be like that. I do so with this tool https://ds11.pdffiller.com which is paid to use but has a free trial period long enough to sort out things with all the files before it ends
  • alana_oalana_o Member Posts: 2
    It's quite difficult to find the problem in code. Maybe it'd be better to ask people, who're working with it. And in case you're not in the IT sphere, you can find some addtional services to help you. To merge 2 files you can use this tool https://pdfliner.com/ds_11_form unfortunately you'll have to pay for it, but prices're not so high
Sign In or Register to comment.