Show / Hide Table of Contents

Class ExportPDFJob

A job which exports a source PDF file to a supported format specified by ExportPDFTargetFormat.

For example, a PDF can be exported to a DOCX file as follows:

Inheritance
System.Object
PDFServicesJob
ExportPDFJob
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class ExportPDFJob : 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());

    ExportPDFParams exportPDFParams = ExportPDFParams.ExportPDFParamsBuilder(ExportPDFTargetFormat.DOCX)
        .Build();
    ExportPDFJob exportPDFJob = new ExportPDFJob(asset, exportPDFParams);
    String location = pdfServices.Submit(exportPDFJob);
    PDFServicesResponse<ExportPDFResult> pdfServicesResponse =
        pdfServices.GetJobResult<ExportPDFResult>(location, typeof(ExportPDFResult));

    IAsset resultAsset = pdfServicesResponse.Result.Asset;
    StreamAsset streamAsset = pdfServices.GetContent(resultAsset);

Constructors

ExportPDFJob(IAsset, ExportPDFParams)

Constructs a new ExportPDFJob instance.

Declaration
public ExportPDFJob(IAsset asset, ExportPDFParams exportPDFParams)
Parameters
Type Name Description
IAsset asset

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

ExportPDFParams exportPDFParams

ExportPDFParams object containing the export parameters; can not be null.

Methods

SetOutput(IAsset)

Sets the output asset for the job.

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

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

Returns
Type Description
ExportPDFJob

ExportPDFJob instance

Remarks

External assets can be set as output only when input is external asset as well

In This Article
  • Constructors
    • ExportPDFJob(IAsset, ExportPDFParams)
  • Methods
    • SetOutput(IAsset)
Back to top Copyright © 2020 Adobe. All rights reserved.