Twain Direct scanner REST API interface for driverless scanning to PDF
mike S
CODE AUTHOR
Posts: 3
mike S created the code: Twain Direct scanner REST API interface for driverless scanning to PDF
//uses the very new TWAIN DIRECT REST api document scanner interface
//select Xerox scanners support this natively today
//thanks to Daryl Foster for the multipart processing object
//quick setup on how to use:
blob lblb_image
nv_twaindirect lnv_twain
lnv_twain = create nv_twaindirect
lnv_twain.of_setport() //set the default port
lnv_twain.of_sethost() //set the scanners IP address
//lnv_twain - set scan settings. general ones are already set
//first create the session, then scan
ls_rval = lnv_twain.of_createsession( )
if isnull(ls_rval) or ls_rval = '' then
messagebox('bad session', 'reboot the scanner')
return
end if
ll_rval = lnv_twain.of_scantoblob(lblb_image ) //scans to the blob
ll_rval = lnv_twain.of_scantofile("c:\mydirectory\filefile.pdf") //scans to a file
ll_rval = lnv_twain.of_closesession( )
//select Xerox scanners support this natively today
//thanks to Daryl Foster for the multipart processing object
//quick setup on how to use:
blob lblb_image
nv_twaindirect lnv_twain
lnv_twain = create nv_twaindirect
lnv_twain.of_setport() //set the default port
lnv_twain.of_sethost() //set the scanners IP address
//lnv_twain - set scan settings. general ones are already set
//first create the session, then scan
ls_rval = lnv_twain.of_createsession( )
if isnull(ls_rval) or ls_rval = '' then
messagebox('bad session', 'reboot the scanner')
return
end if
ll_rval = lnv_twain.of_scantoblob(lblb_image ) //scans to the blob
ll_rval = lnv_twain.of_scantofile("c:\mydirectory\filefile.pdf") //scans to a file
ll_rval = lnv_twain.of_closesession( )
This message has an attachment file.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
mike S
CODE AUTHOR
Posts: 3
mike S replied the code: Twain Direct scanner REST API interface for driverless scanning to PDF
This is for BOTH with PowerServer and PowerBuilder.
It does require PB/PS 2022 or newer (for multi page pdfs)
It does require PB/PS 2022 or newer (for multi page pdfs)
Please Log in or Create an account to join the conversation.