Author |
Topic  |
|
Stalker4
 
Ukraine
54 Posts |
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 ?
|
|
xequte
    
38875 Posts |
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
|
 |
|
Stalker4
 
Ukraine
54 Posts |
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
    
38875 Posts |
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
|
 |
|
|
Topic  |
|