Class ExtractPDFJob
- java.lang.Object
-
- com.adobe.pdfservices.operation.PDFServicesJob
-
- com.adobe.pdfservices.operation.pdfjobs.jobs.ExtractPDFJob
-
public class ExtractPDFJob extends PDFServicesJob
A job that extracts pdf elements such as text, images, tables in a structured format from a PDF. 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()); ExtractPDFParams extractPDFParams = ExtractPDFParams.extractPDFParamsBuilder() .addElementsToExtract(Arrays.asList(ExtractElementType.TEXT)) .build(); ExtractPDFJob extractPDFJob = new ExtractPDFJob(asset).setParams(extractPDFParams); String location = pdfServices.submit(extractPDFJob); PDFServicesResponse<ExtractPDFResult> pdfServicesResponse = pdfServices.getJobResult(location, ExtractPDFResult.class); Asset resultAsset = pdfServicesResponse.getResult().getResource(); StreamAsset streamAsset = pdfServices.getContent(resultAsset);
-
-
Constructor Summary
Constructors Constructor Description ExtractPDFJob(Asset asset)Constructs a newExtractPDFJobinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtractPDFJobsetOutput(Asset asset)Sets the output asset for the job.ExtractPDFJobsetParams(ExtractPDFParams extractPDFParams)Sets the parameters for the job.
-
-
-
Method Detail
-
setParams
public ExtractPDFJob setParams(ExtractPDFParams extractPDFParams)
Sets the parameters for the job.- Parameters:
extractPDFParams-ExtractPDFParamsobject containing the extract PDF parameters; can not be null.- Returns:
ExtractPDFJobinstance
-
setOutput
public ExtractPDFJob 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:
ExtractPDFJobinstance
-
-