hsj wrote:
Any idea what's going on?
WPF report 0 DPI for your image. The MigraDoc code divides by zero and creates an invalid PDF.
There is a quick workaround: set the image resolution in your code (if you continue to use the WPF build):
Code:
image = paragraph.AddImage(@"..\..\..\jpgimg2.jpg");
image.Resolution = 96;
The GDI build return non-zero DPI and all is well. As mentioned before, switching to the GDI build is another option.
MigraDoc should not create invalid PDFs. I will discuss internally what we will do in this case, but it should work properly without setting the resolution.
I'm sorry for the inconvenience. Thank you for your valuable feedback.
JPEGs with 0 DPI must be very rare - this sort of problem was not reported before.