You can scale the image to fit the PDF page using the following code snippet.
Vb
Dim img As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(System.Drawing.Image.FromStream(resourceStream), System.Drawing.Imaging.ImageFormat.Png) img.SetAbsolutePosition(0, 0) 'set the position to bottom left corner of pdf img.ScaleAbsolute(iTextSharp.text.PageSize.A7.Width, iTextSharp.text.PageSize.A7.Height) 'set the height and width of image to PDF page size
FROM#
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(System.Drawing.Image.FromStream(resourceStream, System.Drawing.Imaging.ImageFormat.Png); img.SetAbsolutePosition(0, 0); // set the position to bottom left corner of pdf img.ScaleAbsolute(iTextSharp.text.PageSize.A7.Width,iTextSharp.text.PageSize.A7.Height); // set the height and width of image to PDF page size
If you want the full code (C #), you can also link to the following link. Full code adds an image to all pages of an existing PDF.
fooobar.com/questions/881297 / ...
Deepu reghunath
source share