PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 9:13 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Mar 30, 2010 1:07 pm 
Offline

Joined: Tue Mar 30, 2010 1:03 pm
Posts: 1
The code in question is:

string path = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".pdf";
MemoryStream msPDF = new MemoryStream(fileBytes);
PdfSharp.Pdf.PdfDocument pdfDoc = PdfReader.Open(msPDF, PdfDocumentOpenMode.ReadOnly);

The fileBytes variable gets passed from a FileUpload control and the file being uploaded is a valid PDF.

The last line throws the following error:

[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7471623
System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt) +130
PdfSharp.Pdf.IO.Lexer.ScanNumber() +323
PdfSharp.Pdf.IO.Lexer.ScanNextToken() +152
PdfSharp.Pdf.IO.Parser.ReadSymbol(Symbol symbol) +19
PdfSharp.Pdf.IO.Parser.ReadTrailer() +81
PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) +243
PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, PdfDocumentOpenMode openmode) +10
BEEMarketplace.Business.OrderDocument.Upload(Byte[] fileBytes) +305
BEEMarketplace.UI.Controls.OrderDocuments.btnUpload_Click(Object sender, EventArgs e) +54
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Can someone help me?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 390 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