TwainPdfOCRStartEx Method

See Also     Examples     Applies To

Creates an empty searchable PDF/A file in order to transfer multiple page using the TwainAddGdPictureImageToPdfOCR() until the TwainPdfOCRStop() function is called.
The recognized text will be written invisibly to the PDF in order to simplify indexing and search.

Syntax

object.TwainPdfOCRStartEx (sFilePath, sTitle, sAuthor, sSubject, sKeywords, sCreator, nPdfEncryption, nPDFRight, sUserpassWord, sOwnerPassword)

The TwainPdfOCRStartEx syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
sFilePath Required. String. The path of the PDF to create.
sTitle Optional. String. Default value is "". The PDF Title.
sAuthor Optional. String. Default value is "". The PDF Author.
sSubject Optional. String. Default value is "". The PDF Subject.
sKeywords Optional. String. Default value is "". The PDF Keywords.
sCreator Optional. String. Default value is "". The PDF Creator.
nPdfEncryption Optional. Long. Default value is PdfEncryptionNone. Specifies if the PDF file must be encrypted.
Can be:
PdfEncryptionNone = 0 -> No encryption
PdfEncryption40BitRC4 = 1 -> 40 Bit RC4 encryption
PdfEncryption128BitRC4 = 2 -> 128Bit RC4 encryption
nPDFRight Optional. Long. Default value is PdfRightUndefined. A value returned by the PdfCreateRights function. Available only if nPdfEncryption is not null.
sUserpassWord Optional. String. Default value is "". The user password for the PDF. Can be an empty string. Available only if nPdfEncryption is not null.
sOwnerPassword Optional. String. Default value is "". The owner password for the PDF. Can be an empty string. Available only if nPdfEncryption is not null.

Returns

Long. GdPictureStatus

Remarks

To be used, this function must be unlocked with the SetLicenseNumberOCRTesseract() function.

Category

TWAIN Functions

Visual Basic Sample

How to scan pages of a document feeder to a multipage searchable PDF file.


Object.TwainOpenDefaultSource
Object.TwainSetAutoFeed (True)
Object.TwainSetAutoScan (True)
If Object.TwainPdfOCRStartEx("MyPdf.pdf") = 0 Then
   While Object.CreateImageFromTwain(hwnd) <> 0
         Call Object.TwainAddGdPictureImageToPdfOCR(Object.GetNativeImage, TesseractDictionaryEnglish, App.Path & "\Dict")
         Object.CloseNativeImage
   Wend
   Object.TwainPdfOCRStop
End If
Object.TwainCloseSource






© Copyright 2008 GdPicture All rights reserved.
Documentation MAP.