Class AcroFormOrphanWidgetsProcessor

java.lang.Object
org.apache.pdfbox.pdmodel.fixup.processor.AbstractProcessor
org.apache.pdfbox.pdmodel.fixup.processor.AcroFormOrphanWidgetsProcessor
All Implemented Interfaces:
PDDocumentProcessor

public class AcroFormOrphanWidgetsProcessor extends AbstractProcessor
Generate field entries from page level widget annotations if there AcroForm /Fields entry is empty.
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
  • Constructor Details

    • AcroFormOrphanWidgetsProcessor

      public AcroFormOrphanWidgetsProcessor(PDDocument document)
  • Method Details

    • process

      public void process()
    • resolveFieldsFromWidgets

      private void resolveFieldsFromWidgets(PDAcroForm acroForm)
    • handleAnnotations

      private void handleAnnotations(PDAcroForm acroForm, PDResources acroFormResources, List<PDField> fields, List<PDAnnotation> annotations, Map<String,PDField> nonTerminalFieldsMap)
    • addFontFromWidget

      private void addFontFromWidget(PDResources acroFormResources, PDAnnotation annotation)
      Add font resources from the widget to the AcroForm to make sure embedded fonts are being used and not added by ensureFontResources potentially using a fallback font.
      Parameters:
      acroFormResources - AcroForm default resources, should not be null.
      annotation - annotation, should not be null.
    • resolveNonRootField

      private PDField resolveNonRootField(PDAcroForm acroForm, COSDictionary parent, Map<String,PDField> nonTerminalFieldsMap)
    • ensureFontResources

      private void ensureFontResources(PDResources defaultResources, PDVariableText field)