Hi.
I wrote a simple image to PDF converter using your library. I noticed that for some image files which are wide, they are trimmed and only the left side is visible in the PDF page produced.
So I decided to make an improvement and to make the PDF page to have the exact size of the source image. However, the effect is not what I expect it to be. The PDF page always comes out bigger than the initial image. I think that the measurement units are not the same, but I am not sure. Here is my code:
Code:
PdfDocument doc = new PdfDocument();
doc.Pages.Add(new PdfPage());
XGraphics xgr = XGraphics.FromPdfPage(doc.Pages[0]);
XImage img = XImage.FromFile(source);
doc.Pages[0].Width = img.Size.Width;
doc.Pages[0].Height = img.Size.Height ;
xgr.DrawImage(img, 0, 0);
doc.Save(destinaton);
doc.Close();
How can I improve it, so that the PDF Page will have the exact size of the image?
Thanks.