Class 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 Detail

      • LOG

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

      • AcroFormOrphanWidgetsProcessor

        public AcroFormOrphanWidgetsProcessor​(PDDocument document)
    • Method Detail

      • process

        public void process()
      • resolveFieldsFromWidgets

        private void resolveFieldsFromWidgets​(PDAcroForm acroForm)
      • handleAnnotations

        private void handleAnnotations​(PDAcroForm acroForm,
                                       PDResources acroFormResources,
                                       java.util.List<PDField> fields,
                                       java.util.List<PDAnnotation> annotations,
                                       java.util.Map<java.lang.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.