Page 1 of 1

Problem with pdf file view

Posted: Thursday 25th January 2024 3:45pm
by bill-lancaster
The following code:-

Code: Select all

Public Sub Form_Open()
  hPDF = New PdfDocument(User.Home &/ "Downloads/LancasterLmarriage.pdf")
  hImage = hPDF[0].Render(Desktop.Resolution)
  PictureBox1.W = hImage.W
  PictureBox1.Image = hImage
End
Displays the image OK but part of the left hand side of the image is cut off.
Any help would be welcome

Re: Problem with pdf file view

Posted: Thursday 25th January 2024 7:52pm
by vuott
Try:
hImage = hPDF[0].Render(0, 0, hPDF[0].Render().W, hPDF[0].Render().H, 0, hPDF.Resolution

Re: Problem with pdf file view

Posted: Friday 26th January 2024 8:17am
by bill-lancaster
That works very well vuott,
Thank you, don't know why I didn't think of it!