Class ExtractPDFJob
A job that extracts PDF elements such as text, images, tables in a structured format from a PDF.
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class ExtractPDFJob : 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());
ExtractPDFParams extractPDFParams = ExtractPDFParams.ExtractPDFParamsBuilder()
.AddElementToExtract(ExtractElementType.TEXT)
.Build();
ExtractPDFJob extractPDFJob = new ExtractPDFJob(asset).SetParams(extractPDFParams)
String location = pdfServices.Submit(extractPDFJob);
PDFServicesResponse<ExtractPDFResult> pdfServicesResponse =
pdfServices.GetJobResult<ExtractPDFResult>(location, typeof(ExtractPDFResult));
IAsset resultAsset = pdfServicesResponse.Result.Resource
StreamAsset streamAsset = pdfServices.GetContent(resultAsset);
Constructors
ExtractPDFJob(IAsset)
Constructs a new ExtractPDFJob
instance.
Declaration
public ExtractPDFJob(IAsset asset)
Parameters
Methods
SetOutput(IAsset)
Sets the output asset for the job.
Declaration
public ExtractPDFJob SetOutput(IAsset asset)
Parameters
Returns
Type | Description |
---|---|
Extract |
|
Remarks
External assets can be set as output only when input is external asset as well
SetParams(ExtractPDFParams)
Sets the parameters for the job.
Declaration
public ExtractPDFJob SetParams(ExtractPDFParams extractPDFParams)
Parameters
Type | Name | Description |
---|---|---|
Extract |
extractPDFParams | Extract |
Returns
Type | Description |
---|---|
Extract |
|