Hi, Im trying your sample code for draw an image (jpg) to pdf. Below is my code.
Code:
// Create a new PDF document
PdfDocument document = new PdfDocument();
PdfPage page = document.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
XImage image = XImage.FromFile("D:\\imageFile.jpg");
// draw image to pdf
gfx.DrawImage(image, 0, 0, 250, 140);
// Save the document...
string filename = "D:\\test.pdf";
document.Save(filename);
But it not working, it gave me an error. Can anyone help me?
Here I attach the error.