
DWObject.OpenSource(); DWObject.IfShowUI = false; DWObject.IfDisableSourceAfterAcquire = true; DWObject.PixelType = EnumDWT_PixelType.TWPT_BW; //Black - White image : EnumDWT_PixelType.TWPT_BW, GRAY image: EnumDWT_PixelType.TWPT_GRAY, RGB image: EnumDWT_PixelType.TWPT_RGB DWObject.AcquireImage();
function BeginScan(){
DWObject.OpenSource();
DWObject.IfShowUI = false; //set without user interface
DWObject.IfDisableSourceAfterAcquire = true;
DWObject.AcquireImage();
}
function DWObject_OnPostTransfer(){
DWObject.SaveAsBMP("C:\\temp.bmp",0);
}DWObject.SelectSource(); DWObject.OpenSource(); DWObject.IfShowUI = false; //Set Image Layout DWObject.Unit = EnumDWT_UnitType.TWUN_INCHES; DWObject.SetImageLayout(0, 0, 5, 5); DWObject.AcquireImage();
DWObject.OpenSourceManager();
for(i = 0, i<=DWObject.SourceCount - 1,i++){
if (DWObject.GetSourceNameItems(i) == "Specified device name")
DWObject.SelectSourceByIndex (i);
}
//if can't find the specified source, it'll select default source
DWObject.AcquireImage(); DWObject.IfShowUI = false; DWObject.IfDisableSourceAfterAcquire = true; DWObject.OpenSource(); DWObject.IfShowIndicator = false; DWObject.AcquireImage();
DWObject.SelectSource();
DWObject.OpenSource();
//Set XRESOLUTION current value.
DWObject.Capability = 0x1118; //ICAP_XRESOLUTION
DWObject.CapType = 5; //TWON_ONEVALUE
DWObject.CapValue = 300;
if (DWObject.CapSet == false){
alert( "Failed to set the x-resolution. " + DWObject.ErrorString);
}
//Set YRESOLUTION current value.
DWObject.Capability = 0x1119; //ICAP_YRESOLUTION
DWObject.CapType = 5; //TWON_ONEVALUE
DWObject.CapValue = 200;
if (DWObject.CapSet == false){
alert( "Failed to set the y-resolution." + DWObject.ErrorString);
}
DWObject.AcquireImage();DWObject = document.getElementById("dwtcontrolContainer");
//dwtcontrolContainer is the id of the Dynamic Web TWAIN on the page (An object or an embed).
function btnScan_onclick()
{
DWObject.SelectSource();
DWObject.OpenSource();
DWObject.AcquireImage();
}
function btnUpload_onclick()
{
var strActionPage;
var strHostIP;
var CurrentPathName = unescape(location.pathname); // get current PathName in
plain ASCII
var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/")
+ 1);
strActionPage = CurrentPath + "SaveToFile.aspx"; //the ActionPage's file path
strHostIP = "localhost"; //The host's IP or name
DWObject.HTTPPort = 80;
DWObject.HTTPUploadThroughPost(strHostIP,0,strActionPage,"imageData.tif");
if (DWObject.ErrorCode != 0)
alert(DWObject.ErrorString);
else //succeed
alert("Image Uploaded successfully");
}var iDocumentCounter =0;
function BeginScan(){
DWObject.OpenSource();
DWObject.IfShowUI = false;
DWObject.IfDisableSourceAfterAcquire = true;
if(DWObject.Duplex != TWDX_NONE)
DWObject.IfDuplexEnabled = true; //enable duplex
DWObject.IfFeederEnabled = true;
if (DWObject.IfFeederEnabled == true){
DWObject.XferCount = -1;
if(DWObject.IfFeederLoaded == True)
DWObject.AcquireImage();
}
}
function DWObject_OnPosttransfer(){
iDocumentCounter = iDocumentCounter + 1;
if(DWObject.SaveAsBMP("C:\\Image\\" + iDocumentCounter + ".bmp", 0) == false)
alert( DWObject.ErrorString);
}function btnUpload_onclick()
{
DWObject.HTTPPort = 80;
DWObject.IfSSL = false; // if 80 is the port number of
non-secure port
/*
DWObject.HTTPPort = 443;
DWObject.IfSSL = true; // if 443 is the port number of secure
port
*/
DWObject.HTTPUploadThroughPost("127.0.0.1", 0,
"/SaveToFile.php", "imageData.jpg");
if (DWObject.ErrorCode != 0)
alert(DWObject.ErrorString);
else //succeed
alert("Successful");
}function Scan_Click(){
DWObject.AcquireImage();
}
function DWObject_OnPostTransfer(){
DWObject.CloseSource();
DWObject.IfTiffMultiPage = true;
DWObject.SaveAsTIFF("SaveAsTIFF.tif", 0);
if (DWObject.ErrorCode != 0)
alert (DWObject.ErrorString);
else //succeed
alert ("Successful");
}function NextImage_Click(){
if (DWObject.HowManyImagesInBuffer == 0)
alert ("There is no image in buffer");
DWObject.CurrentImageIndexInBuffer += 1;
}
13.如何进行双面扫描?
function DuplexScan_Click(){
DWObject.SelectSource();
DWObject.OpenSource();
DWObject.IfShowUI = false;
DWObject.IfDuplexEnabled = true; //enable duplex
DWObject.AcquireImage();
} 
dotnet –version
mkdir vbcore cd vbcore dotnet new console -lang VB dotnet run
试用、下载、了解更多产品信息请点击"咨询在线客服"
pdf2cad是一款可将PDF文件转换成CAD格式的转换工具。仅需几秒钟,便可将所提取的准确图形在常规的CAD工具中进行修改,如AutoCAD, TurboCAD和MicroStation。pdf2cad可将PDF工程图输出为DWG, DXF和HPGL格式。pdf2cad格式转换工具适用于Windows或Mac OS X操作系统。
pdf2cad v11提供了许多新功能和增强功能,包括64位版本,支持所有当前的Windows和Mac操作系统,处理受密码保护的PDF文件,更多地控制图像,灵活的页面编号,其他方法来分隔图层等等。





C#: Pop3 pop = new Pop3(); |
VB.NET: Dim pop As Pop3 = New Pop3() |
C#: pop.Connect("mail.domain.com"); |
VB.NET: pop.Connect("mail.domain.com") |
C#: pop.Connect("127.0.0.1"); |
VB.NET: pop.Connect("127.0.0.1") |
C#: pop.Login("login", "password"); |
| VB.NET: pop.Login("login", "password") |
C#: MailMessage msg = pop.DownloadEntireMessage(pop.InboxMessageCount); |
| VB.NET: Dim msg As MailMessage = pop.DownloadEntireMessage(pop.InboxMessageCount) |
C#: pop.Disconnect(); |
| VB.NET: pop.Disconnect() |
C#: using System; using MailBee; using MailBee.Pop3Mail; using MailBee.Mime; namespace EmailApp { class Class1 { [STAThread] static bool IsNewMessage(string UID) { return true; } static void Main(string[] args) { Pop3 pop = new Pop3(); try { pop.Connect("mail.domain.com"); pop.Login("login", "password"); Console.WriteLine("Successfully logged in."); } catch(MailBeePop3LoginNegativeResponseException) { Console.WriteLine("POP3 server replied with a negative response at login."); } string[] arrIDs = pop.GetMessageUids(); int n = pop.InboxMessageCount; if (IsNewMessage(arrIDs[n])) { MailMessage msg = pop.DownloadEntireMessage(n); if (msg.BodyHtmlText != "") Console.WriteLine(msg.BodyHtmlText); else if (msg.BodyPlainText != "") Console.WriteLine(msg.BodyPlainText); else Console.WriteLine("The body of this message is empty."); } try { pop.Disconnect(); Console.WriteLine("Disconnected successfully."); } catch { Console.WriteLine("Disconnection failed."); } } } } |
| VB.NET: Imports System Imports MailBee Imports MailBee.Pop3Mail Imports MailBee.Mime Namespace EmailApp Class Class1 _ Shared Function IsNewMessage(ByVal UID As String) As Boolean Return True End Function Shared Sub Main(ByVal args() As String) Dim pop As Pop3 = New Pop3() Try pop.Connect("mail.domain.com") pop.Login("login", "password") Console.WriteLine("Successfully logged in.") Catch Console.WriteLine("POP3 server replied with a negative response at login.") End Try Dim arrIDs() As String = pop.GetMessageUids() Dim n As Integer = pop.InboxMessageCount If IsNewMessage(arrIDs(n)) Then Dim msg As MailMessage = pop.DownloadEntireMessage(n) If msg.BodyHtmlText <> "" Then Console.WriteLine(msg.BodyHtmlText) Else If msg.BodyPlainText <> "" Then Console.WriteLine(msg.BodyPlainText) Else Console.WriteLine("The body of this message is empty.") End If End If End If Try pop.Disconnect() Console.WriteLine("Disconnected successfully.") Catch Console.WriteLine("Disconnection failed.") End Try End Sub End Class End Namespace |
试用、下载、了解更多产品信息请点击"咨询在线客服"
作为LEADTOOLS v19更新的一部分,新版本向Document Viewer添加了一个新的虚拟文档功能。 LEADTOOLS Document Composer界面可以轻松地从任意数量的页面以及来自多个源文档的文件中创建虚拟文档。你可以在查看该文档时进行修改,并可以使用代码添加或删除页面,也可以使用拖放来进行交互式操作。由Document Composer创建的虚拟文档可以保存在服务器上,与多个用户共享,并导出为任何格式。
从任何源文件中构建或撰写文档意味着什么?想象一下,房地产经纪人准备与客户会面,并想要准备几个房产相关的打印资料。他的计算机或云盘上收集了一些文件:PDF格式的列表、DOCX格式的列表、谷歌地图的截图,甚至是访问其他客户时的一些个人照片。房地产经纪人可以使用LEADTOOLS Document Composer从每个源文件中单击并拖动所需的页面并创建新的虚拟文档,然后将其打印出来参与会议,也可以将虚拟文档导出为新的PDF并通过电子邮件发送。
如果你想要尝试该功能,请查看Document Composer演示应用程序,或直接下载最新的LEADTOOLS安装程序!








