Class CreatePDFJob
- java.lang.Object
-
- com.adobe.pdfservices.operation.PDFServicesJob
-
- com.adobe.pdfservices.operation.pdfjobs.jobs.CreatePDFJob
-
public class CreatePDFJob extends PDFServicesJob
A job that converts a non-PDF file to a PDF file. Some source formats may have associated conversion parameters which can be set in thesetParams(CreatePDFParams)
method.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.DOCX.getMediaType()); CreatePDFJob createPDFJob = new CreatePDFJob(asset); String location = pdfServices.submit(createPDFJob); PDFServicesResponse<CreatePDFResult> pdfServicesResponse = pdfServices.getJobResult(location, CreatePDFResult.class); Asset resultAsset = pdfServicesResponse.getResult().getAsset(); StreamAsset streamAsset = pdfServices.getContent(resultAsset);
-
-
Constructor Summary
Constructors Constructor Description CreatePDFJob(Asset asset)
Constructs a newCreatePDFJob
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreatePDFJob
setOutput(Asset asset)
Sets the output asset for the job.CreatePDFJob
setParams(CreatePDFParams createPDFParams)
Sets the conversion parameters for this job.
-
-
-
Method Detail
-
setParams
public CreatePDFJob setParams(CreatePDFParams createPDFParams)
Sets the conversion parameters for this job. SeeCreatePDFJob
for how to specify the conversion parameters for the different source media types.- Parameters:
createPDFParams
-CreatePDFParams
; can not be null.- Returns:
CreatePDFJob
instance
-
setOutput
public CreatePDFJob setOutput(Asset asset)
Sets the output asset for the job.@note
External assets can be set as output only when input is external asset as well- Parameters:
asset
-Asset
object representing the output asset; can not be null.- Returns:
CreatePDFJob
instance
-
-