Merging PDFs leads to exception

Hi,

When we try to merge the two (same) PDFs, an exception occurs. The PDFs look good and were converted from an ODT with forms to PDF using LibreOffice. All files are attached and a sample application to reproduce it.

Kind Regards,
Andy

ConcatenatePdfs.zip (476,6 KB)

1.pdf (255,8 KB)

@AStelzner

Hi Andy,

Merging the same PDF files can sometimes lead to exceptions due to various reasons, such as file corruption or issues with the PDF structure. Here are a few steps you can take to troubleshoot and resolve the issue:

  1. Check for Corruption: Ensure that the PDF files are not corrupted. You can try opening them in a PDF viewer to confirm they display correctly.

  2. Repair the PDF: If you suspect the PDFs might be corrupted, you can use the LoadOptions with the TryRepair property set to true when loading the PDFs. This can help in repairing minor issues.

    LoadOptions loadOptions = new LoadOptions();
    loadOptions.TryRepair = true;
    
    using (Document pdf1 = new Document("1.pdf", loadOptions))
    using (Document pdf2 = new Document("2.pdf", loadOptions))
    {
        // Merge logic here
    }
    
  3. Use Different Merging Techniques: If the issue persists, consider using a different approach to merge the PDFs, such as creating a new PDF document and adding pages from the existing ones.

  4. Check for Form Fields: Since the PDFs were converted from ODT with forms, ensure that the form fields are not causing the issue. Merging PDFs with interactive elements can sometimes lead to exceptions.

If you continue to face issues, please provide more details about the exception message you are encountering, as that can help in diagnosing the problem further.

Kind Regards,
[Your Name]

PDFs are not corrupt or damaged!!

@AStelzner

We are testing it and will get back to you shortly.

@AStelzner

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-60918

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.