|111233||Sep 13,2013 04:22 AM||Sep 18,2013 12:39 AM||Windows Forms||1|
I am trying to create a pdf document with image file. But it seems to be the image is getting cropped. how do i fit the image in pdf page?
here is the code snipet.
pdfDoc.Pages.Add(); PdfImage pdfImage = PdfImage.FromFile(fileAbsolutePath);
PdfPage pdfPage = pdfDoc.Pages[pdfDoc.Pages.Count - 1];
pdfPage.Graphics.DrawImage(pdfImage, new Point(10,30));Thanks,Tanmaya
Please find the code snippet for inserting an image in the Pdf document as below,
PdfDocument document = new PdfDocument();
PdfPage page = document.Pages.Add();
PdfImage img = PdfImage.FromFile(ImageLocation);
PdfPage pdfPage = document.Pages[document.Pages.Count - 1]; page.Graphics.DrawImage(img,0,0,page.GetClientSize().Width,page.GetClientSize().Height);
Please find our online sample in the link below,
Please let us know if you have any questions.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.