PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Nov 14, 2019 7:28 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Mar 16, 2019 12:50 pm 
Offline

Joined: Wed Feb 27, 2019 7:30 am
Posts: 4
Can anyone help me ? I have code to generate PDF using Memory Stream
using following line
-doc is byte array

PdfSharp.Pdf.PdfDocument pdfFile = PdfSharp.Pdf.IO.PdfReader.Open(new MemoryStream(doc), PdfSharp.Pdf.IO.PdfDocumentOpenMode.Import);

When i reach this line it throws error saying "Invalid PDF file: no trailer found."

When i open document or when i convert it as PDF.pdf file i'm able to view docuument

Please help on this.
Thank you


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2019 1:21 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 498
Location: CCAA
Akshay wrote:
Please help on this.
See also:
viewtopic.php?f=2&t=832

Thank you.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2019 1:37 pm 
Offline

Joined: Wed Feb 27, 2019 7:30 am
Posts: 4
Tried looking for solution in forum but couldn't find anything working


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2019 3:27 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 498
Location: CCAA
CNR, case closed.
https://xkcd.com/583/

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 18, 2019 10:53 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3002
Location: Cologne, Germany
Solution was posted on Stack Overflow:
https://stackoverflow.com/q/55215117/162529

No problem with PDFsharp.
PEBKAC while uploading the PDF to Azure.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 18, 2019 11:13 am 
Offline

Joined: Wed Feb 27, 2019 7:30 am
Posts: 4
Exactly ! Got the solution. @Thomas Hoevel You just re routed to my solution on stack overflow. :lol:


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 18, 2019 4:42 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3002
Location: Cologne, Germany
Akshay wrote:
You just re routed to my solution on stack overflow.
I know.
Methinks the honorable members of this honorable forum deserve to read in this very thread that this non-issue was resolved and that it was not a problem with PDFsharp. The link was provided not for you, but for anybody else.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

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