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 PdfWriter
PdfWriter.PdfBody, PdfWriter.PdfTrailer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayListprivate ArrayListprivate booleanprotected static final HashMap(package private) ArrayListprivate final HashMapprivate RandomAccessFileOrArrayprivate PdfDictionaryprivate booleanprivate static final PdfNameprivate final Documentprivate final ArrayListprivate final ArrayListprivate final HashMapprivate final ArrayList(package private) HashMapprivate final PdfDictionaryprivate HashMapprivate final HashMapprivate static final HashMapprivate static final IntegerFields inherited from class 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
ConstructorsModifierConstructorDescriptionprivatePdfCopyFieldsImp(OutputStream os, char pdfVersion, Calendar globalDate) (package private)PdfCopyFieldsImp(OutputStream os, Calendar globalDate) -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddDocument(PdfReader reader) (package private) voidaddDocument(PdfReader reader, List pagesToKeep) private voidaddPageOffsetToField(HashMap fd, int pageOffset) private voidadjustTabOrder(PdfArray annots, PdfIndirectReference ind, PdfNumber nn) private PdfArraybranchForm(HashMap level, PdfIndirectReference parent, String fname) voidclose()Signals that theDocumentwas closed and that no otherElementswill be added.private voidcloseIt()Creates the new PDF by merging the fields and forms.private voidprivate voidcreateWidgets(ArrayList list, AcroFields.Item item) protected PdfDictionarygetCatalog(PdfIndirectReference rootObj) private static StringgetCOName(PdfReader reader, PRIndirectReference ref) protected intgetNewObjectNumber(PdfReader reader, int number, int generation) private PdfIndirectReferencegetPageReference(int page) Use this method to get a reference to a page existing or not.(package private) RandomAccessFileOrArraygetReaderFile(PdfReader reader) private booleanChecks if a reference refers to a page object.private booleanChecks if a reference has already been "visited" in the copy process.private voidmergeField(String name, AcroFields.Item item) (package private) void(package private) voidvoidopenDoc()private voidpropagate(PdfObject obj, PdfIndirectReference refo, boolean restricted) private booleanSets a reference to "visited" in the copy process.protected voidupdateCalculationOrder(PdfReader reader) Methods inherited from class 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, writeOutlinesMethods inherited from class 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:
DocumentExceptionIOException
-
addDocument
- Throws:
DocumentExceptionIOException
-
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:PdfWriterSignals that theDocumentwas closed and that no otherElementswill 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:
closein interfaceDocListener- Overrides:
closein 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:PdfWriterUse 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:
getPageReferencein classPdfWriter- Parameters:
page- the page number. The first page is 1- Returns:
- the reference to the page
-
getCatalog
- Overrides:
getCatalogin classPdfWriter
-
getNewReference
-
getNewObjectNumber
- Overrides:
getNewObjectNumberin 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:
getReaderFilein classPdfWriter
-
openDoc
public void openDoc()
-