Class DeletePagesJob
- java.lang.Object
-
- com.adobe.pdfservices.operation.PDFServicesJob
-
- com.adobe.pdfservices.operation.pdfjobs.jobs.DeletePagesJob
-
public class DeletePagesJob extends PDFServicesJob
A job to delete pages in a PDF file.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()); PageRanges pageRangeForDeletion = new PageRanges(); pageRangeForDeletion.addSinglePage(1); DeletePagesParams deletePagesParams = new DeletePagesParams(pageRangeForDeletion); DeletePagesJob deletePagesJob = new DeletePagesJob(asset, deletePagesParams); String location = pdfServices.submit(deletePagesJob); PDFServicesResponse<DeletePagesResult> pdfServicesResponse = pdfServices.getJobResult(location, DeletePagesResult.class); Asset deletePagesResult = pdfServicesResponse.getResult().getAsset(); StreamAsset streamAsset = pdfServices.getContent(deletePagesResult);
-
-
Constructor Summary
Constructors Constructor Description DeletePagesJob(Asset asset, DeletePagesParams deletePagesParams)Constructs a newDeletePagesJobinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeletePagesJobsetOutput(Asset asset)Sets the output asset for the job.
-
-
-
Constructor Detail
-
DeletePagesJob
public DeletePagesJob(Asset asset, DeletePagesParams deletePagesParams)
Constructs a newDeletePagesJobinstance.- Parameters:
asset-Assetobject containing the input file; can not be null.deletePagesParams-DeletePagesParamsobject containing the page ranges to be deleted; can not be null.
-
-
Method Detail
-
setOutput
public DeletePagesJob 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:
DeletePagesJobinstance
-
-