Class AcroFormOrphanWidgetsProcessor
java.lang.Object
org.apache.pdfbox.pdmodel.fixup.processor.AbstractProcessor
org.apache.pdfbox.pdmodel.fixup.processor.AcroFormOrphanWidgetsProcessor
- All Implemented Interfaces:
PDDocumentProcessor
Generate field entries from page level widget annotations
if there AcroForm /Fields entry is empty.
-
Field Summary
FieldsFields inherited from class org.apache.pdfbox.pdmodel.fixup.processor.AbstractProcessor
document -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddFontFromWidget(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.private voidensureFontResources(PDResources defaultResources, PDVariableText field) private voidhandleAnnotations(PDAcroForm acroForm, PDResources acroFormResources, List<PDField> fields, List<PDAnnotation> annotations, Map<String, PDField> nonTerminalFieldsMap) voidprocess()private voidresolveFieldsFromWidgets(PDAcroForm acroForm) private PDFieldresolveNonRootField(PDAcroForm acroForm, COSDictionary parent, Map<String, PDField> nonTerminalFieldsMap)
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG
-
-
Constructor Details
-
AcroFormOrphanWidgetsProcessor
-
-
Method Details
-
process
public void process() -
resolveFieldsFromWidgets
-
handleAnnotations
private void handleAnnotations(PDAcroForm acroForm, PDResources acroFormResources, List<PDField> fields, List<PDAnnotation> annotations, Map<String, PDField> nonTerminalFieldsMap) -
addFontFromWidget
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
-