Class DeletePagesJob
A job that deletes pages from a PDF file.
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class DeletePagesJob : 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());
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<DeletePagesResult>(location, typeof(DeletePagesResult));
IAsset resultAsset = pdfServicesResponse.Result.Asset;
StreamAsset streamAsset = pdfServices.GetContent(resultAsset);
Constructors
DeletePagesJob(IAsset, DeletePagesParams)
Constructs a new DeletePagesJob
instance.
Declaration
public DeletePagesJob(IAsset asset, DeletePagesParams deletePagesParams)
Parameters
Type | Name | Description |
---|---|---|
IAsset | asset | The input IAsset for the job; can not be null. |
Delete |
deletePagesParams | Delete |
Methods
SetOutput(IAsset)
Sets the output asset for the job.
Declaration
public DeletePagesJob SetOutput(IAsset asset)
Parameters
Returns
Type | Description |
---|---|
Delete |
|
Remarks
External assets can be set as output only when input is external asset as well