PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Jul 23, 2019 3:55 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Tue Jul 21, 2015 10:42 pm 
Offline

Joined: Tue Jul 21, 2015 10:24 pm
Posts: 6
Hi Thomas ,

We use PDFsharp library extensively in our application as we work alot with pdf files.

we are using version 1.32.2608.0 in our application, we recently got into an issue where when we upload certain pdf files , PDFsharp would fail to read the file throwing error message “Cannot handle iref streams. The current implementation of PDFsharp cannot handle this PDF feature introduced with Acrobat 6."

We used ITextSharp to change the version of the unsupported pdf file on the fly and then PDFsharp was able to read it but the final output (pdf file) generated by PSFsharp would have the content chopped off.

We got to know that iref stream issue in solved with PDFsharp version 1.50.3638.0 so we thought having a small POC to check if it fixes both issues (reading the file & chopping off the content ) . it can read the file with out any issue but it does not prevent the final output from chopping off .

I have attached the files for your refernce.

Please help us with this issue in preventing the file from chopping off the content , Its a critical one and we are trying hard to figure out a solution .

Thanks
Anil


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 22, 2015 6:31 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 316
Hi!
Anil Raju wrote:
I have attached the files for your refernce.
I don't see an attachment.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 22, 2015 4:37 pm 
Offline

Joined: Tue Jul 21, 2015 10:24 pm
Posts: 6
I could not add both the pdf as it said its in invalid format , so I took a screen shot of both the pdf and created a png image and attached it .

Please let me know if you need additional information.

Thanks
Anil


Last edited by Anil Raju on Thu Jul 23, 2015 9:05 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 22, 2015 8:54 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 478
Location: CCAA
Anil Raju wrote:
I could not add both the pdf as it said its in invalid format , so I took a screen shot of both the pdf and created a png image and attached it.
You can zip the PDF files and attach the ZIP file to a post.

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 22, 2015 10:11 pm 
Offline

Joined: Tue Jul 21, 2015 10:24 pm
Posts: 6
Here is the source file, which I will be reading using pdfsharp 1.5 and saving it as show below .


PdfSharp.Pdf.PdfDocument PDFDoc = PdfSharp.Pdf.IO.PdfReader.Open(path);//path is the source file location
PDFDoc.Save("some location to save new file");


Attachments:
File comment: here is the source file
Source file.rar [173.98 KiB]
Downloaded 126 times
Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 22, 2015 10:13 pm 
Offline

Joined: Tue Jul 21, 2015 10:24 pm
Posts: 6
here is the final output file.


Attachments:
File comment: Here is the final output file
Final output file.rar [172.98 KiB]
Downloaded 124 times
Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2015 4:16 pm 
Offline

Joined: Tue Jul 21, 2015 10:24 pm
Posts: 6
HI Thomas/Stefan,
Just following up to see if you guys could figure the problem out ?

Thanks
Anil


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2015 9:04 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 478
Location: CCAA
Anil Raju wrote:
Just following up to see if you guys could figure the problem out?
I don't have a solution yet.

But I assume the workaround shown here will work (or at least will take you one step further):
viewtopic.php?p=2637#p2637

Do not modify the PDF file, create a new, blank PDF file and import the pages one by one. Hope this helps.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2015 9:17 pm 
Offline

Joined: Tue Jul 21, 2015 10:24 pm
Posts: 6
Thank you ,Thomas .
Will Try that suggestion and see if it helps us .

Will keep you updated going further , Thanks once again :)

Thanks
Anil


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

All times are UTC


Who is online

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