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
 Automatic setting of page size and orientation

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
Stalker4 Posted - Mar 05 2025 : 06:48:27
Hi,

There is a TImageEnMView, images of document texts are added to it by scanning or loading from files.
These images can be of different sizes (A3, A4, A5) and orientations (portrait or landscape).
Further all these images of document texts are saved into one pdf-file.

The problem is that the PDF_PaperLayout and PDF_PaperSize values are initially always equal to some default values, not to the actual sheet size and orientation.

At the moment, I have given the user the ability to change the page size and orientation themselves.

But I would like to do it automatically at the moment of loading the document text image into TImageEnMView.
Is there such a possibility in ImageEn ?
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Mar 06 2025 : 16:05:27
OK, thanks for clarifying.

The properties PDF_PaperLayout and PDF_PaperSize are not set when loading images. You should analyze the loaded images and set the properties appropriately, i.e. PDF_PaperSize will be ielLandscape if Image Width > Image Height.

You can use IEPointsToPaperSize() to calculate a value for PDF_PaperLayout, but in reality that will almost always return iepUnknown (because images will rarely match PDF standard sizes) so you should probably just use a default.


Nigel
Xequte Software
www.imageen.com
Stalker4 Posted - Mar 06 2025 : 06:19:59
Hi,

I don't get it, what does TIEPDFViewer have to do with it ? I don't use it in my program.
And TImageEnMView is used to scan ( ImageEnMView.MIO.Acquire() ) pages of document texts or to load them from files ( ImageEnMView.MIO.ExecuteOpenDialog() ) with subsequent saving of all pages into one pdf-file and writing it to the database.

So the question in the first post is still relevant.
xequte Posted - Mar 05 2025 : 21:09:43
Hi

A TImageEnMView loads a PDF has a series of page images (i.e. rasterizing its content, including text), so you should not save in that format or you will create a PDF that just contains images.

You should only use the TIEPDFViewer if you want to load and save PDF files:

https://www.imageen.com/help/TImageEnView.PdfViewer.html

Nigel
Xequte Software
www.imageen.com