imprinter question(s)
My test printer doesn't have an imprinter, so perhaps you could give me a few clues to reduce errors downstream?
We want to print the current image number on each page. Our scanner will have one imprinter. The old scanner had a pre-scan imprinter (which we still use for testing) and the new scanner will have a post-scan imprinter (testing in the future.)
Since there will only be one imprinter, my plan is:
- use
DTWAIN_EnumTwainPrinters()to get the list of (one) printer. - select the enum printer value at position 0, and use
DTWAIN_SetPrinter(...,True)to set this printer's enum as the default. - use
DTWAIN_EnablePrinter()to enable that printer.
We only need to print one line - the image number, in a format like 000001 where the number of leading zeros is fixed.
I see there is a DTWAIN_SetPrinterStartNumber() function, but it does not appear to offer any format control?
There is also a DTWAIN_SetPrinterStrings() function. If we want format control, I'm guessing we should format our string, insert it into the StringArray at position 0, and that would work?
We only need one imprint line - for the image number. If we only put one entry into the StringArray will that be sufficient?
Do I need to mess with DTWAIN_GetPrinterStringMode () or DTWAIN_SetPrinterStringMode or will it default to one line since that's all that we'd put into the printer strings array?
And can I assume that I will be able to update the printer strings array for each image during the callback processing?
As always, thanks for your great support.
I see there is a DTWAIN_SetPrinterStartNumber() function, but it does not appear to offer any format control?
See if the device supports the CAP_PRINTERINDEXLEADCHAR capability. If so, then I suggest trying DTWAIN_SetCapValues using this capability (the data type is an ANSI string with a max of 32 characters).
There is also a DTWAIN_SetPrinterStrings() function. If we want format control, I'm guessing we should format our string, insert it into the StringArray at position 0, and that would work?
Yes, it should work. The underlying DTWAIN code explicitly checks for one item in the array and tries both methods (single / multi-string modes), whichever one "works first".
Also, I suggest getting the TWAIN 2.5 specification for other imprinter cap definitions (the cap names all start with CAP_PRINTER..., so a search through the PDF documentation should find them).
The reason why the spec, in your case, should be used as a guide is that not all of those printer caps have been wrapped by exported DTWAIN functions (the library would increase in size, probably dramatically, as well as the number of exported functions would increase).
Thus it would be better if your application call DTWAIN_GetCapValues and DTWAIN_SetCapValues for those "missing" items that DTWAIN doesn't explicitly export. DTWAIN makes calling DTWAIN_Get/SetCapValues easier in that you don't need to worry about the actual container type (TW_ONEVALUE, TW_ENUMERATION, etc.) and instead only focus on the data type. And even for that, you can call DTWAIN_ArrayCreateFromCap to create the array for you, complete with the correct cap data type.
The DTWAIN Demo32/64 programs have some capacity to show "source properties" on a selected printer.
Are all of the devices properties shown in the JSON Details window of those programs?
Or are there specific properties (like some of these imprinter properties) that might be supported yet won't be in that list?
With the demo program, all the capabilities of the device, number of capabilities, etc. are shown in the lower left list box, and can all be utilized using the DTWAIN_Get/SetCapValues functions.
The JSON details also lists all the capabilities of the device, along with other selected properties of the device (but not all the properties).