I'm writing images from a multi-page TIFF to a PDF using code similar to below:
Public Sub AppendImage(ByVal vPDFDoc As PdfDocument, ByVal vPDFBitmap As Syncfusion.Pdf.Graphics.PdfBitmap, ByVal vFrame As Integer)
Dim pPDFPage As PdfPage = vPDFDoc.Pages.Add
pPDFPage.Section.PageSettings.Margins.All = 0
Dim pGraphics As Syncfusion.Pdf.Graphics.PdfGraphics = pPDFPage.Graphics
vPDFBitmap.ActiveFrame = vFrame
pGraphics.DrawImage(vPDFBitmap, 0, 0, pPDFPage.GetClientSize.Width, pPDFPage.GetClientSize.Height)
End Sub
The above is a helper function. I'm working with some images that are different sizes, some long and some short. When I attempt to set the size of the new instance of the PDFPage, it seems to change the size of ALL the pages in the PDF instead of just the individual page.
pPDFPage.Section.PageSettings.Width = vPDFBitmap.Width
pPDFPage.Section.PageSettings.Height = vPDFBitmap.Height
This results in the resulting PDF displaying images that are stretched or compressed.
http://www.bondsc.com/badpdf.pdf
Please advise.