Package com.aowagie.text.pdf
Class PdfCopyFieldsImp
java.lang.Object
com.aowagie.text.DocWriter
com.aowagie.text.pdf.PdfWriter
com.aowagie.text.pdf.PdfCopyFieldsImp
- All Implemented Interfaces:
DocListener
,ElementListener
,PdfAnnotations
,PdfDocumentActions
,PdfEncryptionSettings
,PdfPageActions
,PdfRunDirection
,PdfVersion
,PdfViewerPreferences
,PdfXConformance
,EventListener
-
Nested Class Summary
Nested classes/interfaces inherited from class com.aowagie.text.pdf.PdfWriter
PdfWriter.PdfBody, PdfWriter.PdfTrailer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayList
private ArrayList
private boolean
protected static final HashMap
(package private) ArrayList
private final HashMap
private RandomAccessFileOrArray
private PdfDictionary
private boolean
private static final PdfName
private final Document
private final ArrayList
private final ArrayList
private final HashMap
private final ArrayList
(package private) HashMap
private final PdfDictionary
private HashMap
private final HashMap
private static final HashMap
private static final Integer
Fields inherited from class com.aowagie.text.pdf.PdfWriter
ALLOW_ASSEMBLY, ALLOW_COPY, ALLOW_DEGRADED_PRINTING, ALLOW_FILL_IN, ALLOW_MODIFY_ANNOTATIONS, ALLOW_MODIFY_CONTENTS, ALLOW_PRINTING, ALLOW_SCREENREADERS, body, CenterWindow, compressionLevel, crypto, currentPdfReaderInstance, DID_PRINT, DID_SAVE, DirectionL2R, DirectionR2L, DisplayDocTitle, DO_NOT_ENCRYPT_METADATA, DOCUMENT_CLOSE, documentOCG, EMBEDDED_FILES_ONLY, ENCRYPTION_AES_128, ENCRYPTION_MASK, FitWindow, fullCompression, GENERATION_MAX, HideMenubar, HideToolbar, HideWindowUI, newBookmarks, NonFullScreenPageModeUseNone, NonFullScreenPageModeUseOC, NonFullScreenPageModeUseOutlines, NonFullScreenPageModeUseThumbs, OCGLocked, OCGRadioGroup, OCProperties, PageLayoutOneColumn, PageLayoutSinglePage, PageLayoutTwoColumnLeft, PageLayoutTwoColumnRight, PageLayoutTwoPageLeft, PageLayoutTwoPageRight, PageModeFullScreen, PageModeUseAttachments, PageModeUseNone, PageModeUseOC, PageModeUseOutlines, PageModeUseThumbs, pdf, pdf_version, PDF_VERSION_1_2, PDF_VERSION_1_3, PDF_VERSION_1_4, PDF_VERSION_1_5, PDF_VERSION_1_6, PDF_VERSION_1_7, PDFA1A, PDFA1B, PDFA2A, PDFA2B, PDFX1A2001, PDFX32002, PDFXNONE, prevxref, PrintScalingNone, root, RUN_DIRECTION_DEFAULT, RUN_DIRECTION_LTR, RUN_DIRECTION_NO_BIDI, RUN_DIRECTION_RTL, STANDARD_ENCRYPTION_128, STANDARD_ENCRYPTION_40, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, VERSION_1_6, VERSION_1_7, WILL_PRINT, WILL_SAVE, xmpMetadata
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PdfCopyFieldsImp
(OutputStream os, char pdfVersion, Calendar globalDate) (package private)
PdfCopyFieldsImp
(OutputStream os, Calendar globalDate) -
Method Summary
Modifier and TypeMethodDescription(package private) void
addDocument
(PdfReader reader) (package private) void
addDocument
(PdfReader reader, List pagesToKeep) private void
addPageOffsetToField
(HashMap fd, int pageOffset) private void
adjustTabOrder
(PdfArray annots, PdfIndirectReference ind, PdfNumber nn) private PdfArray
branchForm
(HashMap level, PdfIndirectReference parent, String fname) void
close()
Signals that theDocument
was closed and that no otherElements
will be added.private void
closeIt()
Creates the new PDF by merging the fields and forms.private void
private void
createWidgets
(ArrayList list, AcroFields.Item item) protected PdfDictionary
getCatalog
(PdfIndirectReference rootObj) private static String
getCOName
(PdfReader reader, PRIndirectReference ref) protected int
getNewObjectNumber
(PdfReader reader, int number, int generation) private PdfIndirectReference
getPageReference
(int page) Use this method to get a reference to a page existing or not.(package private) RandomAccessFileOrArray
getReaderFile
(PdfReader reader) private boolean
Checks if a reference refers to a page object.private boolean
Checks if a reference has already been "visited" in the copy process.private void
mergeField
(String name, AcroFields.Item item) (package private) void
(package private) void
void
openDoc()
private void
propagate
(PdfObject obj, PdfIndirectReference refo, boolean restricted) private boolean
Sets a reference to "visited" in the copy process.protected void
updateCalculationOrder
(PdfReader reader) Methods inherited from class com.aowagie.text.pdf.PdfWriter
add, addAnnotation, addAnnotation, addDeveloperExtension, addDirectImageSimple, addDirectTemplateSimple, addFileAttachment, addFileAttachment, addJavaScript, addLocalDestinations, addSharedObjectsToBody, addSimple, addSimple, addSimpleExtGState, addSimplePattern, addSimplePatternColorspace, addSimpleProperty, addSimpleShading, addSimpleShadingPattern, addToBody, addToBody, addToBody, addToBody, addToBody, addToBody, addViewerPreference, createXmpMetadata, eliminateFontSubset, fillOCProperties, freeReader, getAcroForm, getColorspaceName, getCompressionLevel, getCurrentDocumentSize, getCurrentPage, getCurrentPageNumber, getDefaultColorspace, getDirectContent, getDirectContentUnder, getEncryption, getExtraCatalog, getGroup, getImageReference, getImportedPage, getIndirectReferenceNumber, getInfo, getInstance, getOCProperties, getPageEvent, getPageNumber, getPageSize, getPdfDocument, getPdfIndirectReference, getPdfVersion, getPDFXConformance, getReferenceJBIG2Globals, getRootOutline, getRunDirection, getSpaceCharRatio, getStructureTreeRoot, getTabs, getUserunit, isFullCompression, isPdfX, isRgbTransparencyBlending, isStrictImageSequence, isTagged, isUserProperties, open, propertyExists, registerLayer, releaseTemplate, resetContent, setAdditionalAction, setAtLeastPdfVersion, setCollection, setCompressionLevel, setCropBoxSize, setDuration, setEncryption, setEncryption, setFullCompression, setGroup, setInitialLeading, setOpenAction, setOpenAction, setOutlines, setOutputIntents, setPageAction, setPageEmpty, setPageEvent, setPageLabels, setPageXmpMetadata, setPdfVersion, setPdfVersion, setPDFXConformance, setRgbTransparencyBlending, setRunDirection, setSigFlags, setSpaceCharRatio, setStrictImageSequence, setTabs, setTagged, setThumbnail, setTransition, setUserProperties, setUserunit, setViewerPreferences, setXmpMetadata, writeOutlines
Methods inherited from class com.aowagie.text.DocWriter
add, getISOBytes, isCloseStream, isPaused, newPage, resetFooter, resetHeader, resetPageCount, setCloseStream, setFooter, setHeader, setMarginMirroring, setMarginMirroringTopBottom, setMargins, setPageCount, setPageSize
-
Field Details
-
iTextTag
-
zero
-
readers
-
readers2intrefs
HashMap readers2intrefs -
pages2intrefs
-
visited
-
fields
ArrayList fields -
file
-
fieldTree
-
pageRefs
-
pageDics
-
resources
-
form
-
closing
private boolean closing -
nd
-
tabOrder
-
calculationOrder
-
calculationOrderRefs
-
hasSignature
private boolean hasSignature -
widgetKeys
-
fieldKeys
-
-
Constructor Details
-
PdfCopyFieldsImp
PdfCopyFieldsImp(OutputStream os, Calendar globalDate) throws DocumentException - Throws:
DocumentException
-
PdfCopyFieldsImp
private PdfCopyFieldsImp(OutputStream os, char pdfVersion, Calendar globalDate) throws DocumentException - Throws:
DocumentException
-
-
Method Details
-
addDocument
- Throws:
DocumentException
IOException
-
addDocument
- Throws:
DocumentException
IOException
-
getCOName
-
updateCalculationOrder
- Since:
- 2.1.5; before 2.1.5 the method was private
-
propagate
private void propagate(PdfObject obj, PdfIndirectReference refo, boolean restricted) throws IOException - Throws:
IOException
-
adjustTabOrder
-
branchForm
private PdfArray branchForm(HashMap level, PdfIndirectReference parent, String fname) throws IOException - Throws:
IOException
-
createAcroForms
- Throws:
IOException
-
close
public void close()Description copied from class:PdfWriter
Signals that theDocument
was closed and that no otherElements
will be added.The pages-tree is built and written to the outputstream. A Catalog is constructed, as well as an Info-object, the reference table is composed and everything is written to the outputstream embedded in a Trailer.
- Specified by:
close
in interfaceDocListener
- Overrides:
close
in classPdfWriter
- See Also:
-
closeIt
Creates the new PDF by merging the fields and forms.- Throws:
IOException
-
addPageOffsetToField
-
createWidgets
-
mergeField
-
mergeWithMaster
-
mergeFields
void mergeFields() -
getPageReference
Description copied from class:PdfWriter
Use this method to get a reference to a page existing or not. If the page does not exist yet the reference will be created in advance. If on closing the document, a page number greater than the total number of pages was requested, an exception is thrown.- Overrides:
getPageReference
in classPdfWriter
- Parameters:
page
- the page number. The first page is 1- Returns:
- the reference to the page
-
getCatalog
- Overrides:
getCatalog
in classPdfWriter
-
getNewReference
-
getNewObjectNumber
- Overrides:
getNewObjectNumber
in classPdfWriter
-
setVisited
Sets a reference to "visited" in the copy process.- Parameters:
ref
- the reference that needs to be set to "visited"- Returns:
- true if the reference was set to visited
-
isVisited
Checks if a reference has already been "visited" in the copy process.- Parameters:
ref
- the reference that needs to be checked- Returns:
- true if the reference was already visited
-
isPage
Checks if a reference refers to a page object.- Parameters:
ref
- the reference that needs to be checked- Returns:
- true is the reference refers to a page object.
-
getReaderFile
- Overrides:
getReaderFile
in classPdfWriter
-
openDoc
public void openDoc()
-