T O P I C R E V I E W |
Stalker4 |
Posted - Jan 16 2025 : 05:40:04 Hi,
Delphi 12.1, ImageEn 13.0.
1) Do I understand correctly that if I need specific properties of TWAIN or WIA interfaces (read/write) when working with AcquireParams, I can access them. specific properties of TWAIN or WIA interfaces (read/write), they can be accessed in the following way can be accessed in the following way:
with ImageEnMView.MIO do
if AcquireParams.SelectedSource.API = ieaTwain then
AcquireParams.AttachedTwainParams.Brightness.CurrentValue := 50
else
if AcquireParams.SelectedSource.API = ieaWIA then begin
AcquireParams.AttachedWIAParams.GetItemPropertyAttrib(WIA_IPS_BRIGHTNESS, AcquireParams.AttachedWIAParams.Device, ieAttrib, ieValues);
nMin := ieValues.Min
end;
2) The TWAIN interface has AcceptedImages and StandardSize properties for setting the number of sheets and sheet size. The WIA interface or TAcquireParams does not have these properties. Question: WIA interface does not support these features (properties) or they are not implemented in your system ?
3) When saving the scan result to PDF
with ImageEnMView.MIO do
for nCou := 0 to ImageEnMView.ImageCount-1 do begin
Params[nCou].PDF_Compression := ioPDF_JPEG;
Params[nCou].PDF_Creator := 'My Creater';
end;
ImageEnMView.MIO.SaveToStreamPDF(FStream);
There are string properties, e.g. PDF_Creator or PDF_Author. Question: In which encoding of them are the string data written to PDF ? I need to understand how to write Cyrillic encoded strings to these fields.
|
12 L A T E S T R E P L I E S (Newest First) |
Stalker4 |
Posted - Jan 27 2025 : 02:38:30 The codes for the constants WIA_IPS_PAGE_SIZE and WIA_IPS_PAGES were found on the Internet.
#define WIA_IPS_PAGES 3096 // 0xc18
#define WIA_IPS_PAGES_STR L"Pages"
#define WIA_IPS_PAGE_SIZE 3097 // 0xc19
#define WIA_IPS_PAGE_SIZE_STR L"Page Size"
I made a small modification to your demo "AllAcquire": I added Edit1 (TEdit) to the form and added this code to the end of the SaveProperties procedure:
if ImageEnMView1.MIO.AcquireParams.SelectedSource.API = ieaTwain then
ImageEnMView1.MIO.AcquireParams.AttachedTwainParams.AcceptedImages := StrToInt(Edit1.Text)
else
if ImageEnMView1.MIO.AcquireParams.SelectedSource.API = ieaWIA then
ImageEnMView1.MIO.AcquireParams.AttachedWIAParams.SetDeviceProperty(3096, StrToInt(Edit1.Text));
I made a small modification to your demo “AllAcquire”: I added Edit1 (TEdit) to the form and added this code to the end of the SaveProperties procedure:
1) I enter in Edit1 the number 2, that is, that would scan only 2 pages, I select the TWAIN-driver, Duplex mode is disabled, I press the “Acquire” button.
The scanner loaded ALL the sheets of paper that were in the sheet holder, but the program itself (in ImageEnMView1) transferred only 2 sheets.
The fact that the scanner loaded ALL sheets of paper despite the “AcceptedImages” property being set, is this how it should be ?
2) I enter in Edit1 the number 2, i.e. to scan only 2 pages, select WIA-driver, Duplex mode is disabled, press “Acquire” button.
The scanner loaded all sheets of paper that were in the sheet holder, and in the program itself (in ImageEnMView1) transferred also ALL sheets.
So it turns out that the code did not work at all for WIA.
|
xequte |
Posted - Jan 25 2025 : 13:01:28 Sorry, I'm out of the office this week. You should just google the values.
Nigel Xequte Software www.imageen.com
|
Stalker4 |
Posted - Jan 24 2025 : 03:58:21 I read your letter.
Where to get the numerical value for WIA_IPS_PAGE_SIZE and WIA_IPS_PAGES ?
P.S. According to the documentation you gave me a link to (thank you very much for that), WIA_DPS_PAGES is not supported in WIndows Vista and higher.
|
xequte |
Posted - Jan 24 2025 : 03:17:53 Thanks, I've replied to your email.
WIA_DPS_PAGE_SIZE is deprecated, you should use WIA_IPS_PAGE_SIZE.
You cannot use the Twain constants for that. The WIA constants are:
https://learn.microsoft.com/en-us/windows/win32/wia/-wia-wia2-pagesizeconstants
Nigel Xequte Software www.imageen.com
|
Stalker4 |
Posted - Jan 24 2025 : 03:08:17 Sent you a reply to your e-mail via your forum profile.
These constants (IETW_NONE, IETW_A3, IETW_A4, IETW_A5, IETW_A6) can be used for SetDeviceProperty(WIA_DPS_PAGE_SIZE, ) ? |
xequte |
Posted - Jan 23 2025 : 15:28:14 Sorry, I cannot find an order for you. Can you email me your details.
I've added AcquireCount which supports WIA_DPS_PAGES, but this is also marked as Experimental as we do not have adequate devices to test it on.
Nigel Xequte Software www.imageen.com
|
Stalker4 |
Posted - Jan 23 2025 : 04:00:29 Hi,
These constants can be used for SetDeviceProperty(WIA_DPS_PAGE_SIZE, ) ?
By the way, do I understand correctly that WIA_DPS_PAGES is used to set the number of pages to scan, for example SetDeviceProperty(WIA_DPS_PAGES, -1) or SetDeviceProperty(WIA_DPS_PAGES, 5) ? If I'm right, you could add a property for the AcquireParams interface for this as well.
|
xequte |
Posted - Jan 22 2025 : 20:04:50 Hi
Please email us for the latest beta. We have added an experimental AcquireParams.StandardSize property. You pass Twain page consts to it, but it works for both Twain and WIA.
Nigel Xequte Software www.imageen.com
|
Stalker4 |
Posted - Jan 22 2025 : 01:19:54 Where to get the constants to set the paper size for the SetDeviceProperty method ?
I mean constants like IETW_NONE, IETW_A3, IETW_A4, IETW_A5, IETW_A6, but for WIA. |
xequte |
Posted - Jan 17 2025 : 18:32:59 2. In WIA 2.0 there is a page size property, WIA_IPS_PAGE_SIZE, but we have not implemented that yet. You could implement it using:
https://www.imageen.com/help/TIEWia.GetDeviceProperty.html https://www.imageen.com/help/TIEWia.SetDeviceProperty.html
3. Yes, we have it on our to-do list.
Nigel Xequte Software www.imageen.com
|
Stalker4 |
Posted - Jan 17 2025 : 03:50:57 2) Your answer is clear, but I find it strange that the WIA interface has no properties for page size or number of sheets of paper, it turns out that there are scanners with automatic sheet feeder, but it is impossible to control the number of sheets through WIA ....
3) Then there is a suggestion, if possible, to add properties for Unicode string format there. |
xequte |
Posted - Jan 16 2025 : 19:43:06 Hi
1. Yes, you can either use the AcquireParams properties which set the Twain/WIA properties, or you can set them directly via AttachedTwainParams/AttachedWIAParams. The result will be the same.
2. I would need to research the equivalent properties in WIA
3. At this time, only ANSI strings are supported
Nigel Xequte Software www.imageen.com
|
|
|