Show / Hide Table of Contents

Class CreatePDFJob

A job that converts a non-PDF file to a PDF file. Some source formats may have associated conversion parameters which can be set using the CreatePDFParams.

Inheritance
System.Object
PDFServicesJob
CreatePDFJob
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class CreatePDFJob : 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());
    CreatePDFJob createPDFJob = new CreatePDFJob(asset);
    String location = pdfServices.Submit(createPDFJob);
    PDFServicesResponse<CreatePDFResult> pdfServicesResponse =
        pdfServices.GetJobResult<CreatePDFResult>(location, typeof(CreatePDFResult));

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

Constructors

CreatePDFJob(IAsset)

Constructs a new CreatePDFJob instance.

Declaration
public CreatePDFJob(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 CreatePDFJob SetOutput(IAsset asset)
Parameters
Type Name Description
IAsset asset

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

Returns
Type Description
CreatePDFJob

CreatePDFJob instance

Remarks

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

SetParams(CreatePDFParams)

Sets the parameters for the job.

Declaration
public CreatePDFJob SetParams(CreatePDFParams createPDFParams)
Parameters
Type Name Description
CreatePDFParams createPDFParams

CreatePDFParams for the job.

Returns
Type Description
CreatePDFJob

CreatePDFParams instance

In This Article
Back to top Copyright © 2020 Adobe. All rights reserved.