Class SplitPDFJob
- java.lang.Object
-
- com.adobe.pdfservices.operation.PDFServicesJob
-
- com.adobe.pdfservices.operation.pdfjobs.jobs.SplitPDFJob
-
public class SplitPDFJob extends PDFServicesJob
A job that splits PDF document into multiple smaller documents by simply specifying either the number of files, pages per file, or page ranges.Sample Usage:
InputStream inputStream = new FileInputStream(new File("SOURCE_PATH")); Credentials credentials = new ServicePrincipalCredentials( System.getenv("PDF_SERVICES_CLIENT_ID"), System.getenv("PDF_SERVICES_CLIENT_SECRET")); PDFServices pdfServices = new PDFServices(credentials); Asset asset = pdfServices.upload(inputStream, PDFServicesMediaType.PDF.getMediaType()); SplitPDFParams splitPDFParams = new SplitPDFParams().setPageCount(2); SplitPDFJob splitPDFJob = new SplitPDFJob(asset, splitPDFParams); String location = pdfServices.submit(splitPDFJob); PDFServicesResponse<SplitPDFResult> pdfServicesResponse = pdfServices.getJobResult(location, SplitPDFResult.class); List<Asset> resultAssets = pdfServicesResponse.getResult().getAssets(); int index = 0; for (Asset resultAsset : resultAssets) { StreamAsset streamAsset = pdfServices.getContent(resultAsset); index++; }
-
-
Constructor Summary
Constructors Constructor Description SplitPDFJob(Asset asset, SplitPDFParams splitPDFParams)Constructs a newSplitPDFJobinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SplitPDFJobsetOutput(Asset asset)Sets the output asset for the job.
-
-
-
Constructor Detail
-
SplitPDFJob
public SplitPDFJob(Asset asset, SplitPDFParams splitPDFParams)
Constructs a newSplitPDFJobinstance.- Parameters:
asset-Assetobject containing the input file; can not be null.splitPDFParams-SplitPDFParamsobject containing the parameters for splitting the PDF; can not be null.
-
-
Method Detail
-
setOutput
public SplitPDFJob setOutput(Asset asset)
Sets the output asset for the job.@noteExternal assets can be set as output only when input is external asset as well- Parameters:
asset-Assetobject representing the output asset; can not be null.- Returns:
SplitPDFJobinstance
-
-