ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PdfViewer.Objects.AddImage: PdfViewer.PageWidth vs. 595 px
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

135 Posts

Posted - Aug 27 2024 :  15:30:38  Show Profile  Reply
Hi,

using ImageEnView1.PdfViewer.Objects.AddImage to let an image (width = 1234 px) exactly fit the page width (PdfViewer.PageWidth = 992 px), setting width = ImageEnView1.PdfViewer.PageWidth adds a too large image:

ImageEnView1.PdfViewer.LoadFromFile(pdf);
ImageEnView1.PdfViewer.Objects.AddImage(0, 530, ImageEnView1.PdfViewer.PageWidth, -1, bmp);


Meanwhile, width = 595 (value taken from the TIEPDFBuilder help page) correctly fits the image to the page width:

ImageEnView1.PdfViewer.LoadFromFile(pdf);
ImageEnView1.PdfViewer.Objects.AddImage(0, 530, 595, -1, bmp);


Does this mean that to position an object on a pdf page, the page is always divided in 595 horizontal and 842 vertical points, indipendently of PdfViewer.PageWidth and PdfViewer.PageHeight?

Ale

xequte

38616 Posts

Posted - Aug 28 2024 :  00:27:50  Show Profile  Reply
Hi Ale

The values in AddImage() are in PDF points, whereas PageWidth,PageHeight are the size in pixels (adjusted by the current DPI and page rotation).

https://www.imageen.com/help/TIEPdfViewer.PageWidth.html

To get the page size in PDF points, see the example at:

https://www.imageen.com/help/TIEPdfViewer.CurrentPage.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: