PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Jun 12, 2021 5:54 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

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

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);

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.

Reply with quote  
PostPosted: Wed Oct 26, 2016 11:34 am 
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3048
Location: Cologne, Germany

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.

Thomas Hoevel
PDFsharp Team

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: No registered users and 1 guest

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