Merge PDF Issue

Hello, We are using Aspose.pdf version 12.0.0, we are using this for long time for merging the list of document we receive from different vendors and make it as single pdf. And recently we are facing an issue with one of the document which has some fillable fields. we could add all the documents to the IEnumerable of PdfDocument variable and when we call Merge operation, it returns 0 bytes. If I exclude that one document which has that fillable fields (not sure that is the issue), then the merge is successful. And I could save and open that problem document separately and problem is only when merging with other documents. So can you please let me know, if there is something that we need to change to fix this issue on our side?

Specification: Windows 2019 Server
.Net version : 4.0
Aspose.pdf version --> 12.0.0

also, if there is any fix already for this kind of issue? please share the details and the version, as we are on .Net 4.0, do we have fix for the same version of Aspose.pdf?

Thanks

@prabhu.subramaniam1

We are afraid that you are using quite older version of the API and a lot of methods and classes have been removed since then. You can please try using 23.6 (the latest) version of the API to test if it is working correctly. You can obtain 30-days free temporary license to evaluate it. In case issue still persists, please share your sample PDF along with sample code so that we can test the scenario in our environment and address it accordingly.

@asad.ali, is 23.6 version compatible with .Net version 4.0? is there any old thread related to this kind of issue before? and fixed in any version?

@prabhu.subramaniam1

Yes, you can use 23.6 version with .NET 4.0. However, support for .NET 4.0 client profile has been discontinued from this version. Furthermore, we are afraid that we cannot find similar issue in our logs that was reported and fixed in any version.

The error was reported few years back on the following forum. It was said that it got fixed in Java based dll.
we tried in Aspose.PDF - Version 17 and the issue was still there
we tried with Aspose.PDF - Version 23.4 it was fixed in that partially. It depends on how we merge. When we merge using stream, it works.
When we try to add the PDF, one by one to merge for a path, the tags are getting missed from second pdf.

Like the below. we would loose the tags on Concat2.pdf after merge

// Open first document
Document pdfDocument1 = new Document(_dataDir + "Concat1.pdf");
// Open second document
Document pdfDocument2 = new Document(_dataDir + "Concat2.pdf");

// Add pages of second document to the first
document1.Pages.Add(document2.Pages);
document.Save(_dataDir+"ConcatenatedPDF.pdf");
 
[PDFileEditor.concatenate() produces zero byte output PDF - Free Support Forum - aspose.com](https://forum.aspose.com/t/pdfileeditor-concatenate-produces-zero-byte-output-pdf/79993/12)

@SVijay

Sometimes, issues are related only with the specific type of PDF documents and they are resolved only for those files. Different scenarios and different document structures can cause issues and they need to be investigated accordingly. Can you please share your sample PDF documents for our reference so that we can test the scenario in our environment and address it accordingly? Are you using Aspose.PDF for Java?

no we are using Aspose.PDF for .NET only.
attached SamplePDF1, SamplePDF2 and merged PDF using .NET 4.0 sample version of Aspose.PDF - V23.6

Concatenation is done like the below and tags from second document is not there.

// Open first document
Document pdfDocument1 = new Document(_dataDir + “Concat1.pdf”);
// Open second document
Document pdfDocument2 = new Document(_dataDir + “Concat2.pdf”);

// Add pages of second document to the first
document1.Pages.Add(document2.Pages);
document.Save(_dataDir+“ConcatenatedPDF.pdf”);

SamplePDF2.pdf (61.6 KB)
SamplePDF1.pdf (61.3 KB)
Merged.pdf (196.7 KB)

we created those PDF from word–>saved as PDF. If we open individual PDF’s tags will be there but after merge, tags will disappear from second PDF or target pdf which is getting merged

@prabhu.subramaniam1

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-55023

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Any update on this?

@hariprasanth1998

We are afraid that the earlier logged ticket has not been yet resolved due to other pending issues in the queue. Nevertheless, we have recorded your concerns and will surely inform you once we make some progress towards its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.