The Dynamic Web Twaintwain Scan Recognition tool adds text to the image Dynamic Web Twain is a TWAIN scan recognition tool applied to a Web application that simply writes a few lines of code on the Twain interface, You can scan a document with a TWAIN-compatible scanner or obtain an image from a digital camera/capture card and process the captured image. Version support
Dynamic WEB TWAIN versions V7 and above
Grammar
Boolean Objectname.addtext (short imageindex, int x, int y, String Text, int textcolor, int
BackgroundColor, float Backgroundroundradius, float backgroundopacity)
Parameters
- Short ImageIndex: Target image index
- Int x: The x-coordinate of the text
- Int y: The y-coordinate of the text
- String text: The text to be added
- Int textcolor: Text color
- Int backgroundcolor: Background color
- Float Backgroundroundradius: The range is 0 to 0.5; Note: This parameter is not supported for Mac edition.
- Float backgroundopacity: Specifies the opacity of the added text background, ranging from 0 to 1.0; Note: Mac version supports 0 to 1.
return value
Boolean:true indicates success, false indicates failure
Mark
When the Ifthrowexception property is true, an exception is thrown when an error occurs. When you return false or throw an exception, check the ErrorCode property and the ErrorString property for an error message.
Example
Here is a JavaScript example:
<script language= "javascript" type= "text/javascript" > dwobject = document.getElementById (" Idynamicwebtwain ");//idynamicwebtwain is the ID of the the Dynamic Web TWAIN on the page (a object or an embed). f Unctionbtnaddtext_onclick () { dwobject.addtext ( DWObject.CurrentImageIndexInBuffer, document.getelementbyid ("Addtext_left"). Value,//value for setting the X coordinate for the text document.getelementbyid ("Addtext_top"). Value,//Value for setting the Y Coordinate for the Text document.getelementbyid ("AddText_Text"). Value,//the text to be Added document.getelementbyid ("AddText_ Txtcolor "). Value,//the color of the Text document.getelementbyid ("Addtext_bgcolor "). Value,//the background color of the text document.getElementById ("Addtext_bgroundradius"). Value,//the value for the background radius document.getelementbyid ("Addtext_bgopacity"). Value//the value for the background opacity ); } </script>