Class CompressPDFJob
A job that reduces the size of a PDF file. Allows specifying Compression
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class CompressPDFJob : 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());
CompressPDFJob compressPDFJob = new CompressPDFJob(asset);
String location = pdfServices.Submit(compressPDFJob);
PDFServicesResponse<CompressPDFResult> pdfServicesResponse =
pdfServices.GetJobResult<CompressPDFResult>(location, typeof(CompressPDFResult));
IAsset resultAsset = pdfServicesResponse.Result.Asset;
StreamAsset streamAsset = pdfServices.GetContent(resultAsset);
Constructors
CompressPDFJob(IAsset)
Constructs a new CompressPDFJob
instance.
Declaration
public CompressPDFJob(IAsset asset)
Parameters
Methods
SetOutput(IAsset)
Sets the output asset for the job.
Declaration
public CompressPDFJob SetOutput(IAsset asset)
Parameters
Returns
Type | Description |
---|---|
Compress |
|
Remarks
External assets can be set as output only when input is external asset as well
SetParams(CompressPDFParams)
Sets the parameters for the job.
Declaration
public CompressPDFJob SetParams(CompressPDFParams compressPDFParams)
Parameters
Type | Name | Description |
---|---|---|
Compress |
compressPDFParams | Compress |
Returns
Type | Description |
---|---|
Compress |
|