Show / Hide Table of Contents

Class SplitPDFJob

A job that splits PDF document into multiple smaller documents by simply specifying either the number of files, pages per file, or page ranges.

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

    SplitPDFParams splitPDFParams = new SplitPDFParams();
    splitPDFParams.SetPageCount(2);
    SplitPDFJob splitPDFJob = new SplitPDFJob(asset, splitPDFParams);
    String location = pdfServices.Submit(splitPDFJob);
    PDFServicesResponse<SplitPDFResult> pdfServicesResponse =
        pdfServices.GetJobResult<SplitPDFResult>(location, typeof(SplitPDFResult));

    List<IAsset> resultAssets = pdfServicesResponse.Result.Assets;
    foreach (IAsset resultAsset in resultAssets)
    {
        StreamAsset streamAsset = pdfServices.GetContent(resultAsset);
    }

Constructors

SplitPDFJob(IAsset, SplitPDFParams)

Constructs a new SplitPDFJob instance.

Declaration
public SplitPDFJob(IAsset asset, SplitPDFParams splitPDFParams)
Parameters
Type Name Description
IAsset asset

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

SplitPDFParams splitPDFParams

SplitPDFParams object containing the parameters for splitting the PDF; can not be null.

Methods

SetOutput(IAsset)

Sets the output asset for the job.

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

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

Returns
Type Description
SplitPDFJob

SplitPDFJob instance

Remarks

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

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