PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Older PDF Files
http://forum.pdfsharp.com/viewtopic.php?f=2&t=4201
Page 1 of 1

Author:  pangolin [ Tue Nov 17, 2020 2:46 am ]
Post subject:  Older PDF Files

I have PDF files that have "no trailer". I need to load them and merge them with other PDF files then write a composite file.

IS there a way to load these ignoring the no trailer exception/error and have them load so I can use them?

Loading using:
PdfDocument inputDocument = PdfReader.Open(file, PdfDocumentOpenMode.Import);

The PDFs are version 1.3 and possibly 1.4. IS there a load I can do to get it loaded or a repair using just PdfSharp so I can automate this?

Thanks

Author:  TH-Soft [ Tue Nov 17, 2020 7:23 am ]
Post subject:  Re: Older PDF Files

If Adobe Reader can open the files then iTextSharp probably also can.

Maybe you can modify PDFsharp so those files also open with PDFsharp. But "out of the box" it will most likely not work.

Author:  pangolin [ Tue Nov 17, 2020 3:57 pm ]
Post subject:  Re: Older PDF Files

TH-Soft wrote:
If Adobe Reader can open the files then iTextSharp probably also can.

Maybe you can modify PDFsharp so those files also open with PDFsharp. But "out of the box" it will most likely not work.


I was hoping not to have to alter the code but if that's the way forward I'll do it. Was hoping I could just eat the exception and continue trucking on. But I don't think the file is actually loaded when this exception is thrown.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/