Class ExportPDFJob
- java.lang.Object
-
- com.adobe.pdfservices.operation.PDFServicesJob
-
- com.adobe.pdfservices.operation.pdfjobs.jobs.ExportPDFJob
-
public class ExportPDFJob extends PDFServicesJob
A job which exports a source PDF file to a supported format specified byExportPDFTargetFormat.For example, a PDF can be exported to a DOCX file as follows:
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()); ExportPDFParams exportPDFParams = ExportPDFParams.exportPDFParamsBuilder(ExportPDFTargetFormat.DOCX).build(); ExportPDFJob exportPDFJob = new ExportPDFJob(asset, exportPDFParams); String location = pdfServices.submit(exportPDFJob); PDFServicesResponse<ExportPDFResult> pdfServicesResponse = pdfServices.getJobResult(location, ExportPDFResult.class); Asset resultAsset = pdfServicesResponse.getResult().getAsset(); StreamAsset result = pdfServices.getContent(resultAsset);
-
-
Constructor Summary
Constructors Constructor Description ExportPDFJob(Asset asset, ExportPDFParams exportPDFParams)Constructs a newExportPDFJobinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExportPDFJobsetOutput(Asset asset)Sets the output asset for the job.
-
-
-
Constructor Detail
-
ExportPDFJob
public ExportPDFJob(Asset asset, ExportPDFParams exportPDFParams)
Constructs a newExportPDFJobinstance.- Parameters:
asset-Assetobject containing the input file; can not be null.exportPDFParams-ExportPDFParamsobject containing the export parameters; can not be null.
-
-
Method Detail
-
setOutput
public ExportPDFJob 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:
ExportPDFJobinstance
-
-