I have a PDF image that contains the entire webpage, including the part you can't view (when you scroll down).
I want to convert the PNG to a PDF. When I convert the image, the entire image appears on one page in the PDF and in really small print. I want the PNG to be normal page width and potentially multiple pages.
Here is the VB.Net code that creates the PDF:
Dim doc As New PdfDocument
Dim section As PdfSection = doc.Sections.Add
Dim page As PdfPageBase = doc.Pages.Add
Dim image As PdfImage = PdfImage.FromFile("C:\temp\PACER\CAPTURE\test.png")
Dim widthFitRate As Single = image.PhysicalDimension.Width / page.Canvas.ClientSize.Width
Dim heightFitRate As Single = image.PhysicalDimension.Height / page.Canvas.ClientSize.Height
Dim fitRate As Single = Math.Max(widthFitRate, heightFitRate)
Dim fitWidth As Single = image.PhysicalDimension.Width / fitRate
Dim fitHeight As Single = image.PhysicalDimension.Height / fitRate
page.Canvas.DrawImage(image, 30, 30, fitWidth, fitHeight)
doc.SaveToFile("C:\temp\PACER\CAPTURE\test.pdf")
doc.Close()