Forum Replies Created
- AuthorPosts
@jimwatters wrote:
I am not familiar with the Marshal method you are using to allocate and fill the capability. But it looks to me that you are not allocating enough memory.
There is an example in the spec in section 2-19 for STR32 that should be easy to change to STR255.
Marshal.WriteInt32(pv, 2, Convert.ToInt32(value));
If Value is a STR255 then you probably want to use a method similar to
Marshal.WriteString(pv, 255, value);You might also want to do a MSG_GET on CAP_PRINTERSTRING and see what is supported. There might be some predefined strings in the enumeration.
Regards,
Jim Watters**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************The marshal method just writes the handle into memory. My issue is I just need to see how someone (who has set an imprinter through code) did theirs.
Parts of this twain spec are greek to me. Some others are easy to understand. This is the greek part.
This is what I have so far
using TwainLib;
if (HasCapability(CAPABILITIES.PRINTER))
{
SetCap(CAPABILITIES.PRINTER, (short)PRINTER.ENDORSER_BOTTOMAFTER);
SetCap(CAPABILITIES.PRINTERENABLED, (short)BOOL.True);
}if (HasCapability(CAPABILITIES.PRINTERINDEX))
{
SetCap(CAPABILITIES.PRINTERINDEX, (short)1);
SetCap(CAPABILITIES.PRINTERMODE, (short)PRINTERMODE.SINGLESTRING);}
all of that works but as far as printer string
if(HasCapability(CAPABILITIES.PRINTERSTRING))
{
string date = DateTime.Today.ToString(“ddMMMyyyy”);Capability cp = new Capability(CAPABILITIES.PRINTERSTRING, TYPES.STR255, date);
It takes me to this area
public Capability(CAPABILITIES capName, TYPES iType, object value)
{
Cap = (short)capName;
ConType = (short)CONTAINERS.ONEVALUE;
Int32 strptr = default(Int32);
switch (iType)
{
case TYPES.FIX32:
conHandle = Marshal.AllocHGlobal(2 + Marshal.SizeOf(typeof(Fix32)));
Marshal.WriteInt16(conHandle, 0, (short)iType);
Marshal.WriteInt16(conHandle, 2, ((Fix32)value).Whole);
Marshal.WriteInt16(conHandle, 4, (short)((Fix32)value).Frac);
break;default:
conHandle = GlobalMemory.GlobalAlloc(0x42, 6);
IntPtr pv = GlobalMemory.GlobalLock(conHandle);
Marshal.WriteInt16(pv, 0, (short)TYPES.INT16);
Marshal.WriteInt32(pv, 2, Convert.ToInt32(value)); <--- errors here saying cannot convert string to intGlobalMemory.GlobalUnlock(conHandle);
break;
The users that I work for would like to be able to print information on the back of scanned pages as to keep a physical record of things being scanned.
I’m sure there are better and easier ways to accomplish this same goal but this is what they want so I have to give it to them.
@HOHXP wrote:
Why use VRS ? Skip the cost and do everthing in the application. Modern documentsscanners delivers jpeg compressed data so a straight forward USB connection is more than enough to drive even high-speed scanners at full speed. A good app uses the mulitcore in modern PCs to scan and process the documents at the same time
VRS along with the adrenaline card cleans images to a level that a standalone program cannot achieve.
I am currently writing a scanning app that uses the vrs functionality with twain.
I havent ran into the issues described above. The only issue I have ran into is that with the vrs once the source is opened it must stay open. If the source is closed and then reopened in the same session, the vrs will crash.
Did you install the vrs twain driver off the dvd?
There has got to be a way to set the border detection dynamically without the use of twack32
Anyone have an update on this? I am having this issue as well
I figured it out. I was using a WIA Fujitsu source and not the actual Fujitsu source. Bad things happen with WIA
My scanner is fujitsu 6670.
When I check the capabilites in twacker I still get the BADCAP message.
What puzzles me is that when I set Enable Duplex in the scanners UI everything works. What is happening in the UI with Duplex that is working and why cant it work in twacker or in my code?
is there an update on this? I have the same issue with it being a white border below the image that is not cropped.
- AuthorPosts