Class AutotagPDFJob


  • public class AutotagPDFJob
    extends PDFServicesJob
    A job that creates PDF documents with enhanced readability from existing PDF documents. An optional tagging report can also be generated which contains the information about the tags that the tagged output PDF document contains.

    Accessibility tags, used by assistive technology such as screen reader are required to make PDF files compliant. However, the generated PDF is not guaranteed to comply with accessibility standards such as WCAG and PDF/UA as there could be a need to perform further downstream remediation to meet those standards.

    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());
                 AutotagPDFJob autotagPDFJob = new AutotagPDFJob(asset);
                 String location = pdfServices.submit(autotagPDFJob);
                 PDFServicesResponse<AutotagPDFResult> pdfServicesResponse = pdfServices.getJobResult(location, AutotagPDFResult.class);
    
                 Asset assetTaggedPDF = pdfServicesResponse.getResult().getTaggedPDF();
                 StreamAsset streamAsset = pdfServices.getContent(assetTaggedPDF);
      
    • Constructor Detail

      • AutotagPDFJob

        public AutotagPDFJob​(Asset asset)
        Constructs a new AutotagPDFJob instance with input asset.
        Parameters:
        asset - The input asset for the job; can not be null.