Show / Hide Table of Contents

Class CombinePDFJob

A job that combines multiple PDF files into a single PDF file. Allows specifying which pages of the source files to combine.

Inheritance
System.Object
PDFServicesJob
CombinePDFJob
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class CombinePDFJob : PDFServicesJob
Examples

Sample Usage:

    using Stream inputStream1 = File.OpenRead("<SOURCE_PATH>");
    using Stream inputStream2 = 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 asset1 = pdfServices.Upload(inputStream1, PDFServicesMediaType.PDF.GetMIMETypeValue());
    IAsset asset2 = pdfServices.Upload(inputStream2, PDFServicesMediaType.PDF.GetMIMETypeValue());

    CombinePDFParams combinePDFParams = CombinePDFParams.CombinePDFParamsBuilder()
        .AddAsset(assets1)
        .AddAsset(assets2)
        .Build();
    CombinePDFJob combinePDFJob = new CombinePDFJob(combinePDFParams);
    String location = pdfServices.Submit(combinePDFJob);
    PDFServicesResponse<CombinePDFResult> pdfServicesResponse =
        pdfServices.GetJobResult<CombinePDFResult>(location, typeof(CombinePDFResult));

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

Constructors

CombinePDFJob(CombinePDFParams)

Constructs a new CombinePDFJob instance.

Declaration
public CombinePDFJob(CombinePDFParams combinePDFParams)
Parameters
Type Name Description
CombinePDFParams combinePDFParams

CombinePDFParams object containing the input files and the page ranges to be combined; can not be null.

Methods

SetOutput(IAsset)

Sets the output asset for the job.

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

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

Returns
Type Description
CombinePDFJob

CombinePDFJob instance

Remarks

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

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