PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Nov 10, 2024 7:47 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Sep 21, 2009 2:59 pm 
Offline

Joined: Tue Aug 25, 2009 7:26 pm
Posts: 5
I am getting this error with my pdf document.

Token 'xref' was not expected

The line of code that is throwing this error is
Using InputDoc As PdfSharp.Pdf.PdfDocument = PdfSharp.Pdf.IO.PdfReader.Open(inputPath, PdfSharp.Pdf.IO.PdfDocumentOpenMode.Import)

The file that I am using has no security and can be opened with all versions of Acrobat. If anyone has a fix for this please let me know


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 21, 2009 3:40 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3111
Location: Cologne, Germany
hmtech wrote:
The file that I am using has no security and can be opened with all versions of Acrobat.

Can it be opened with Acrobat Reader 5.0?

AFAIK XREF and IREF are new features of Adobe 6.0 that are not yet implemented.

Save that PDF file in Adobe 5.0 format (PDF 1.4) and it should work.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 21, 2009 4:23 pm 
Offline

Joined: Tue Aug 25, 2009 7:26 pm
Posts: 5
Thanks Thomas.

The PDF Version is 1.3 and The PDF Producer is Acrobat Distiller 5.0.5 (Windows)

I have not yet tried opening with Acrobat 5.0 ans I have Acrobat 8.0 installed on my machine.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 22, 2009 6:45 pm 
Offline

Joined: Tue Aug 25, 2009 7:26 pm
Posts: 5
I tried working with another dll and that one is throwing this error.

'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

Something is definitely wrong with my pdf. Does this error tell anything about the file?


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 23, 2009 8:01 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3111
Location: Cologne, Germany
hmtech wrote:
Does this error tell anything about the file?

No.

And "PdfSharp.Pdf.IO.PdfReader.Open" is only the entry point - the error occurs deep down in another routine, so this doesn't say much about the error either.

If there are errors in the file: if you open the file with Adobe Acrobat (not the Reader) and close it, and if Acrobat then prompts to save changes it has fixed some errors. Then you should save the file and try again.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 29, 2010 4:14 pm 
Offline

Joined: Tue Aug 25, 2009 7:26 pm
Posts: 5
"if you open the file with Adobe Acrobat (not the Reader) and close it, and if Acrobat then prompts to save changes it has fixed some errors. Then you should save the file and try again"

Is there a way to do this programmatically?

Thanks


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 25 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:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group