Wrong Operand Type Error

Nov 13, 2010 at 2:21 AM

I'm saving JPEG's to a PDF.  It works great until I get to about 25 pages.  There are no errors during runtime, but when I open the PDF I get an error message at about page 25: "Wrong operand type" and the remaining pages in the PDF are blank.

Nov 13, 2010 at 3:51 AM

It seems to be a DPI issue.  The 96 DPI photos are working but the 200, 300 & 600 DPI are not.  Here is my code:

XImage photo = XImage.FromStream(e.Result as Stream);
gfx.DrawImage(photo, destRect, sourceRect, XGraphicsUnit.Point);

Where the stream is a WebClient download of a JPEG file.