We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Does the entire PDF have to be the same size?

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.

1 Reply

PH Praveenkumar H Syncfusion Team October 28, 2013 04:16 AM UTC

Hi John,

Thank you for your interest in Syncfusion products.

We are able to reproduce the issue.

Could you please report this issue through Direct Trac Developer Support System (https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Regards,
Praveen


Loader.
Live Chat Icon For mobile
Up arrow icon