PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon May 28, 2018 3:07 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon May 14, 2018 6:32 am 
Offline

Joined: Mon May 14, 2018 6:19 am
Posts: 1
Hi,
I use PDFTRon for .NET to generate a PDF from Word documents. But when I send the generated document through PDFSharp component to validate the document it fails with the following error.

Exception message: Object already in table.
Stack trace: at PdfSharp.Pdf.Advanced.PdfCrossReferenceTable.Add(PdfReference iref)
at PdfSharp.Pdf.IO.Parser.ReadXRefStream(PdfCrossReferenceTable xrefTable)
at PdfSharp.Pdf.IO.Parser.ReadXRefTableAndTrailer(PdfCrossReferenceTable xrefTable)
at PdfSharp.Pdf.IO.Parser.ReadTrailer()
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode)
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, PdfDocumentOpenMode openmode)
at BoardAppUtil.Util.FileUtility.ValidatePDFRestrictedModification(Byte[] fileData) in D:\Projects\BoardPACWeb_TFS_Workspace\BoardApp\Web\BoardAppWeb\BoardAppUtil\Util\FileUtility.cs:line 260


Following line is used to open the PDFTron generated PDF to modify by the PDFSharp.
I need to add an additiona page to this document. I use PDFSharp for that.

PdfDocument inputDocument1 = PdfReader.Open(pdfStm, PdfDocumentOpenMode.Modify);

I can send the PDFTron generated document which fails the PDFSharp's "Open" function. (Please specify an email address)


Top
 Profile  
Reply with quote  
PostPosted: Mon May 14, 2018 9:33 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2815
Location: Cologne, Germany
Hi!

This is the result from QPDF:
Code:
D:>qpdf --check "PDFTron converted file.pdf"
checking PDFTron converted file.pdf
PDF Version: 1.7
File is not encrypted
File is linearized
ERROR: linearized file contains an uncompressed object after a compressed one in a cross-reference stream
WARNING: page 0 has shared identifier entries
WARNING: page 0: shared object 7: in hint table but not computed list
WARNING: page 0: shared object 8: in hint table but not computed list
WARNING: page 0: shared object 9: in hint table but not computed list
WARNING: page 0: shared object 10: in hint table but not computed list

AFAIK the object 14 0 appears twice in the PDF file. Adobe Reader uses one and ignores the other, PDFsharp throws an exception.
I do not know which ob those two objects should be prioritized and which should be ignored.

BTW: A GIF file with 6350 bytes is converted to a 7039 JPEG file and then embedded in PDF.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group