![]() |
Creates an empty searchable PDF stream with encryption in order to transfer multiple page using the PdfAddGdPictureImageToPdfOCR() until the PdfOCRStop() function is called.
The recognized text will be written invisibly to the PDF in order to simplify indexing and search.
public int PdfOCRStartStream( ref Stream PDFStream, String Title, String Author, String Subject, String Keywords, String Creator, PdfEncryption Encryption, PdfRight Rights, String UserPassword, String OwnerPassword );
Public Function PdfOCRStartStream( ByRef PDFStream As Stream, ByVal Title As String, ByVal Author As String, ByVal Subject As String, ByVal Keywords As String, ByVal Creator As String, ByVal Encryption As PdfEncryption, ByVal Rights As PdfRight, ByVal UserPassword As String, ByVal OwnerPassword As String ) As Integer
|
Parameters |
Description |
|
PDFStream |
The Stream object to save the PDF. |
|
Title |
The title of the PDF. |
|
Author |
The PDF Author. |
|
Subject |
The PDF Subject. |
|
Keywords |
The PDF Keywords. |
|
Creator |
The name of the application which creates the PDF. |
|
Encryption |
A member of the PdfEncryption enumeration. Note: AES encyption is not yet available. |
|
Rights |
A value returned by the PdfCreateRights function. |
|
UserPassword |
The user password for the PDF. Can be an empty string. |
|
OwnerPassword |
The owner password for the PDF. Can be an empty string. |
0: The PDF could not created. Use the GetStat() function to determine the reason this function failed.
Non-zero: A PDF Identifier.
To be used, this function must be unlocked with the SetLicenseNumberOCRTesseract() function.
How to scan pages of a document feeder to a multipage searchable PDF file with 128 bits RC4 encryption.
Dim oGdPictureImaging As New GdPictureImaging Dim ImageID As Integer Dim PDFStream As IO.Stream = New IO.MemoryStream Dim bContinue As Boolean = True Dim PdfID As Integer oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by a demo or commercial license key oGdPictureImaging.TwainOpenDefaultSource(Me.Handle) oGdPictureImaging.TwainSetAutoFeed(True) oGdPictureImaging.TwainSetAutoScan(True) PdfID = oGdPictureImaging.PdfOCRStartStream(PDFStream, "", "", "", "", "", PdfEncryption.PdfEncryption128BitRC4,PdfRight.PdfRightCanView or PdfRight.PdfRightCanPrint,"UserPass", OwnerPass") If PdfID <> 0 Then While bContinue ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle) oGdPictureImaging.PdfAddGdPictureImageToPdfOCR(PdfID, ImageID, TesseractDictionary.TesseractDictionaryEnglish, "C:Program FilesGdPicture.NETRedistOCR", "") oGdPictureImaging.ReleaseGdPictureImage(ImageID) bContinue = (oGdPictureImaging.TwainGetState > TwainStatus.TWAIN_SOURCE_ENABLED) End While oGdPictureImaging.PdfOCRStop(PdfID) End If oGdPictureImaging.TwainCloseSource()
|
What do you think about this topic? Send feedback!
|
|
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.
|