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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PdfViewer.Objects.AddImage: PdfViewer.PageWidth vs. 595 px

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
aleatprog Posted - Aug 27 2024 : 15:30:38
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
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 28 2024 : 00:27:50
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