PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Oct 17, 2017 2:49 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Oct 25, 2016 5:43 pm 
Offline

Joined: Tue Oct 25, 2016 5:34 pm
Posts: 1
I am using PDFSharp v1.32 with GDI in Visual Studio 2015 C# and below is the code I am using with a list of tif image files:

PdfSharp.Pdf.PdfDocument document = new PdfSharp.Pdf.PdfDocument();

foreach (string tiffile in tiffiles)
{
PdfSharp.Pdf.PdfPage page = document.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
XImage ximg = XImage.FromFile(tiffile);
gfx.DrawImage(ximg, 0, 0);
}
document.Save(outputPdfName);


I do not get any error's but when opening various PDF files there are random images/pages within that generate the "Insufficient Image Data" error and a blank page is displayed in Adobe Reader DC, or Irfanview, or FoxitReader and various other readers). The tif images the error occurs on are tiff group IV black and white images. It occurs at random, as I have run through a list of 10 tif images and it will occur on only the 5th page in the generated PDF. I ran it against various different sets of images, and the same thing occurs, and it's not reliable with the results.

Any idea what could cause this, or what changes in code I could make to get it working?

I also tried using another tif to PDF toolkit(ImageMagick) and it did not have any issues so I may just go with that one.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 26, 2016 11:34 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2719
Location: Cologne, Germany
Hi!

Switch to PDFsharp 1.50 beta 3b. The issue should not occur.

If it does occur with the latest version, too, then please provide a VS solution with a TIFF file that allows us to replicate the issue.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] 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:  
Powered by phpBB® Forum Software © phpBB Group