Class PDFPropertiesJob


  • public class PDFPropertiesJob
    extends PDFServicesJob
    A job that is used to fetch properties from an input PDF file. The properties are returned in a POJO.

    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());
    
                 PDFPropertiesParams pdfPropertiesParams = PDFPropertiesParams.pdfPropertiesParamsBuilder()
                         .includePageLevelProperties()
                         .build();
                 PDFPropertiesJob pdfPropertiesJob = new PDFPropertiesJob(asset)
                         .setParams(pdfPropertiesParams);
    
                 String location = pdfServices.submit(pdfPropertiesJob);
                 PDFServicesResponse<PDFPropertiesResult> pdfServicesResponse = pdfServices.getJobResult(location, PDFPropertiesResult.class);
    
                 PDFProperties pdfProperties = pdfServicesResponse.getResult().getPdfProperties();
     
    • Constructor Detail

      • PDFPropertiesJob

        public PDFPropertiesJob​(Asset asset)
        Constructs a new PDFPropertiesJob instance.
        Parameters:
        asset - Asset object containing the input file; can not be null.
    • Method Detail

      • setParams

        public PDFPropertiesJob setParams​(PDFPropertiesParams pdfPropertiesParams)
        Set params for the job.
        Parameters:
        pdfPropertiesParams - PDFPropertiesParams object containing the properties to be fetched; can not be null.
        Returns:
        PDFPropertiesJob instance