Show / Hide Table of Contents

Class ExtractPDFJob

A job that extracts PDF elements such as text, images, tables in a structured format from a PDF.

Inheritance
System.Object
PDFServicesJob
ExtractPDFJob
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
Type Name Description
IAsset asset

The input IAsset for the job; can not be null.

Methods

SetOutput(IAsset)

Sets the output asset for the job.

Declaration
public ExtractPDFJob SetOutput(IAsset asset)
Parameters
Type Name Description
IAsset asset

IAsset object representing the output asset; can not be null.

Returns
Type Description
ExtractPDFJob

ExtractPDFJob instance

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
ExtractPDFParams extractPDFParams

ExtractPDFParams for the job.

Returns
Type Description
ExtractPDFJob

ExtractPDFJob instance

In This Article
  • Constructors
    • ExtractPDFJob(IAsset)
  • Methods
    • SetOutput(IAsset)
    • SetParams(ExtractPDFParams)
Back to top Copyright © 2020 Adobe. All rights reserved.