Class OCRJob
A job that convert a PDF file into a searchable PDF file. Allows specifying locale(
OCRSupported
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class OCRJob : PDFServicesJob
Examples
Sample Usage:
using Stream inputStream = File.OpenRead("<SOURCE_PATH>");
ICredentials credentials = new ServicePrincipalCredentials(
Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_ID"),
Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_SECRET"));
PDFServices pdfServices = new PDFServices(credentials);
IAsset asset = pdfServices.Upload(inputStream, PDFServicesMediaType.PDF.GetMIMETypeValue());
OCRJob ocrJob = new OCRJob(asset);
String location = pdfServices.Submit(ocrJob);
PDFServicesResponse<OCRResult> pdfServicesResponse =
pdfServices.GetJobResult<OCRResult>(location, typeof(OCRResult));
IAsset resultAsset = pdfServicesResponse.Result.Asset;
StreamAsset streamAsset = pdfServices.GetContent(resultAsset);
Constructors
OCRJob(IAsset)
Constructs a new Autotag
Declaration
public OCRJob(IAsset asset)
Parameters
Type | Name | Description |
---|---|---|
IAsset | asset | The input asset for the job; can not be null. |
Methods
SetOutput(IAsset)
Sets the output asset for the job.
Declaration
public OCRJob SetOutput(IAsset asset)
Parameters
Returns
Type | Description |
---|---|
OCRJob |
|
Remarks
External assets can be set as output only when input is external asset as well
SetParams(OCRParams)
Sets the parameters for the job.
Declaration
public OCRJob SetParams(OCRParams ocrParams)
Parameters
Returns
Type | Description |
---|---|
OCRJob |
|