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
 Memorizes the orientation of the scan page
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Stalker4

Ukraine
54 Posts

Posted - Mar 06 2025 :  08:35:05  Show Profile  Reply
Hi,

1) Scanning two pages:
ImageEnMView.MIO.Acquire()
The default orientation of the pages is portrait.

2) I select the last page and change its orientation:
ImageEnMView.MIO.Params[ImageEnMView.SelectedImage].PDF_PaperLayout := ielLandscape;

3) I scan the third page and this page has a landscape orientation for some reason.
I checked, if I don't change the orientation of the second page to landscape, then the orientation of the third page will not change either (i.e. it will be portrait).

It turns out that when adding another scanned page to ImageEnMView, its orientation is taken from the last page.

Question: Is there any way to cancel this behavior ?

xequte

38875 Posts

Posted - Mar 06 2025 :  15:58:01  Show Profile  Reply
Hi

If PDF_PaperLayout is not set, it should always default to ielPortrait.

Can you please give me some reproducible code that shows this issue? I tried the following, and i correctly created a PDF that is Portrait/Landscape/Portrait:

ImageEnMView1.AppendImage( 'D:\Testing_Multimedia\Portrait1.jpg' );
//ImageEnMView1.MIO.Params[0].PDF_PaperLayout := ielPortrait;
ImageEnMView1.AppendImage( 'D:\Testing_Multimedia\Portrait2.jpg' );
ImageEnMView1.MIO.Params[1].PDF_PaperLayout := ielLandscape;
ImageEnMView1.AppendImage( 'D:\Testing_Multimedia\Portrait3.jpg' );
//ImageEnMView1.MIO.Params[2].PDF_PaperLayout := ielPortrait;
ImageEnMView1.MIO.SaveToFilePDF('D:\out2.pdf')


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Stalker4

Ukraine
54 Posts

Posted - Mar 07 2025 :  06:46:31  Show Profile  Reply
Hi,

If you add images from files to ImageEnMView, the problem is not reproduced.

You should add images to ImageEnMView only through scanning:
ImageEnMView.MIO.Acquire()
Go to Top of Page

xequte

38875 Posts

Posted - Mar 11 2025 :  15:16:02  Show Profile  Reply
Sorry, i have checked the code. When appending bitmaps (via scanning or just adding), the parameters default to the last used. They are not reset, so if you set ielLandscape, you should then set ielPortrait.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Stalker4

Ukraine
54 Posts

Posted - Mar 12 2025 :  07:34:34  Show Profile  Reply
Hi,

How can you set a default value for PDF_PaperLayout before starting scanning ?
Go to Top of Page

xequte

38875 Posts

Posted - Mar 12 2025 :  19:19:12  Show Profile  Reply
Hi

You are better to leave them at the default and then set the layout afterwards, e.g. using the OnAfterAcquireBitmap event:

https://www.imageen.com/help/TImageEnMIO.OnAfterAcquireBitmap.html

Or by iterating over the images when Acquire completes.

// Add a description to all scanned images
ImageEnMView.MIO.OnAfterAcquireBitmap := AfterAcquireBitmap;

procedure TForm1.AfterAcquireBitmap(Sender: TObject; index: Integer);
begin
  ImageEnMView1.ImageTopText[ index ] := 'Image scanned on ' + DateTimeToStr( now );
end;




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