Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.fixup.processor

public Class AcroFormOrphanWidgetsProcessor

extends AbstractProcessor
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .HashMap, .List, .Map, org.apache.commons.logging.Log, .LogFactory, org.apache.fontbox.ttf.TrueTypeFont, org.apache.pdfbox.cos.COSDictionary, .COSName, org.apache.pdfbox.pdmodel.PDDocument, .PDPage, .PDResources, org.apache.pdfbox.pdmodel.font.FontMapper, .FontMappers, .FontMapping, .PDType0Font, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, .PDAnnotationWidget, .PDAppearanceStream, org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm, .PDField, .PDFieldFactory, .PDVariableText

Generate field entries from page level widget annotations if there AcroForm /Fields entry is empty.

Field Summary

Modifier and TypeField and Description
private static final Log
Inherited from org.apache.pdfbox.pdmodel.fixup.processor.AbstractProcessor:
document

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addFontFromWidget(PDResources
AcroForm default resources, should not be null.
acroFormResources
,
PDAnnotation
annotation, should not be null.
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 void
private void
handleAnnotations(PDAcroForm acroForm, PDResources acroFormResources, List<PDField> fields, List<PDAnnotation> annotations, Map<String, PDField> nonTerminalFieldsMap)

public void
private void
private PDField
resolveNonRootField(PDAcroForm acroForm, COSDictionary parent, Map<String, PDField> nonTerminalFieldsMap)

Field Detail

LOGback to summary
private static final Log LOG

Constructor Detail

AcroFormOrphanWidgetsProcessorback to summary
public AcroFormOrphanWidgetsProcessor(PDDocument document)

Method Detail

addFontFromWidgetback to summary
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:PDResources

AcroForm default resources, should not be null.

annotation:PDAnnotation

annotation, should not be null.

ensureFontResourcesback to summary
private void ensureFontResources(PDResources defaultResources, PDVariableText field)
handleAnnotationsback to summary
private void handleAnnotations(PDAcroForm acroForm, PDResources acroFormResources, List<PDField> fields, List<PDAnnotation> annotations, Map<String, PDField> nonTerminalFieldsMap)
processback to summary
public void process()

Implements org.apache.pdfbox.pdmodel.fixup.processor.PDDocumentProcessor.process.

Annotations
@Override
resolveFieldsFromWidgetsback to summary
private void resolveFieldsFromWidgets(PDAcroForm acroForm)
resolveNonRootFieldback to summary
private PDField resolveNonRootField(PDAcroForm acroForm, COSDictionary parent, Map<String, PDField> nonTerminalFieldsMap)