PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Generated PDF Errors

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
aknuth



Joined: 23 Mar 2007
Posts: 16
Location: Berlin

PostPosted: Fri Aug 17, 2007 6:26 pm    Post subject: Generated PDF Errors Reply with quote

Hello,
I used migradoc 1.2.1930.0 and pdfsharp 0.9.653.0 to create a pdf file. However I cannot import that pdf file using pdflib as it says it contains errors.

Furthermore when I open the pdf file using Adobe Acrobat, the file is being repaired. After that I installed another analyzing tool that spit out the following errors:

2x The end-of-file marker was not found.
1x The 'startxref' keyword or the xref position was not found.

If somebody got a clue or might be able to help me, I can send the "corrupted" pdf for further examination. Just cannot post it here as it contains internal information.

Regards,
André
Back to top
View user's profile Send private message Visit poster's website
aknuth



Joined: 23 Mar 2007
Posts: 16
Location: Berlin

PostPosted: Sat Aug 18, 2007 3:26 pm    Post subject: Reply with quote

Something to add:

After trying to open the generated PDF using PdfReader.Open I get the following error:

Code:
PdfSharp.Pdf.IO.PdfReaderException: Token '' was not expected.
   bei PdfSharp.Pdf.IO.Parser.ReadSymbol(Symbol symbol) in D:\Projects2\delivergo\PDFSharp 1.0.898\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\Parser.cs:Zeile 541.
   bei PdfSharp.Pdf.IO.Parser.ReadTrailer() in D:\Projects2\delivergo\PDFSharp 1.0.898\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\Parser.cs:Zeile 711.
   bei PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) in D:\Projects2\delivergo\PDFSharp 1.0.898\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\PdfReader.cs:Zeile 275.
   bei PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode) in D:\Projects2\delivergo\PDFSharp 1.0.898\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\PdfReader.cs:Zeile 247.
   bei PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, PdfDocumentOpenMode openmode) in D:\Projects2\delivergo\PDFSharp 1.0.898\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\PdfReader.cs:Zeile 232.


Regards,
André
Back to top
View user's profile Send private message Visit poster's website
aknuth



Joined: 23 Mar 2007
Posts: 16
Location: Berlin

PostPosted: Sun Aug 19, 2007 4:44 pm    Post subject: Reply with quote

Hi there,
I produced the fault on my own, but I want others to not run into the same problem. I used a MemoryStream to save the generated document in. Later on I need a byteArray out of that(for a webservice).

To get the byteArray I used the
Code:
memoryStream.GetBuffer()
method of the MemoryStream which unfortunately gets the whole buffer INCLUDING zero padding at the end of the stream. So that is what produced the "corrupted" pdf files.

MemoryStreams grow dynamically and when the size is being increased the yet unused space is filled with zeros. So better use
Code:
memoryStream.ToArray
for small amount of data or something like
Code:
fileStream.Write(memoryStream.GetBuffer(), 0, memoryStream.Position);
when using big files.

Regards,
André
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com