Package com.lowagie.text.pdf
Class PdfCopyFieldsImp
java.lang.Object
com.lowagie.text.DocWriter
com.lowagie.text.pdf.PdfWriter
com.lowagie.text.pdf.PdfCopyFieldsImp
- All Implemented Interfaces:
DocListener
,ElementListener
,PdfAnnotations
,PdfDocumentActions
,PdfEncryptionSettings
,PdfPageActions
,PdfRunDirection
,PdfVersion
,PdfViewerPreferences
,PdfXConformance
,AutoCloseable
,EventListener
- Direct Known Subclasses:
PdfCopyFormsImp
-
Nested Class Summary
Nested classes/interfaces inherited from class com.lowagie.text.pdf.PdfWriter
PdfWriter.PdfBody, PdfWriter.PdfTrailer
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
(package private) List
<AcroFields> (package private) RandomAccessFileOrArray
(package private) PdfDictionary
private boolean
private static final PdfName
(package private) Document
(package private) List
<PdfDictionary> (package private) List
<PdfIndirectReference> private final Map
<PdfReader, IntHashtable> (package private) Map
<PdfReader, IntHashtable> (package private) PdfDictionary
private final Map
<PdfReader, IntHashtable> private static final Integer
Fields inherited from class com.lowagie.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, colorNumber, compressionLevel, crypto, currentPageNumber, currentPdfReaderInstance, defaultColorspace, DID_PRINT, DID_SAVE, directContent, directContentUnder, DirectionL2R, DirectionR2L, DisplayDocTitle, DO_NOT_ENCRYPT_METADATA, DOCUMENT_CLOSE, documentColors, documentExtGState, documentFonts, documentOCG, documentOCGorder, documentPatterns, documentProperties, documentShadingPatterns, documentShadings, documentSpotPatterns, EMBEDDED_FILES_ONLY, ENCRYPTION_AES_128, ENCRYPTION_AES_256_V3, ENCRYPTION_MASK, ENCRYPTION_NONE, extraCatalog, FitWindow, fontNumber, formXObjects, formXObjectsCounter, fullCompression, GENERATION_MAX, group, HideMenubar, HideToolbar, HideWindowUI, imageDictionary, importedPages, JBIG2Globals, newBookmarks, NO_SPACE_CHAR_RATIO, NonFullScreenPageModeUseNone, NonFullScreenPageModeUseOC, NonFullScreenPageModeUseOutlines, NonFullScreenPageModeUseThumbs, OCGLocked, OCGRadioGroup, OCProperties, PAGE_CLOSE, PAGE_OPEN, PageLayoutOneColumn, PageLayoutSinglePage, PageLayoutTwoColumnLeft, PageLayoutTwoColumnRight, PageLayoutTwoPageLeft, PageLayoutTwoPageRight, PageModeFullScreen, PageModeUseAttachments, PageModeUseNone, PageModeUseOC, PageModeUseOutlines, PageModeUseThumbs, pageReferences, patternColorspaceCMYK, patternColorspaceGRAY, patternColorspaceRGB, patternNumber, 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, PDFX1A2001, PDFX32002, PDFXNONE, prevxref, PrintScalingNone, root, RUN_DIRECTION_DEFAULT, RUN_DIRECTION_LTR, RUN_DIRECTION_NO_BIDI, RUN_DIRECTION_RTL, runDirection, SIGNATURE_APPEND_ONLY, SIGNATURE_EXISTS, SPACE_CHAR_RATIO_DEFAULT, STANDARD_ENCRYPTION_128, STANDARD_ENCRYPTION_40, structureTreeRoot, tabs, tagged, userunit, 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
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addDocument
(PdfReader reader) (package private) void
addDocument
(PdfReader reader, List<Integer> pagesToKeep) (package private) void
addPageOffsetToField
(Map<String, AcroFields.Item> fd, int pageOffset) private void
adjustTabOrder
(PdfArray annots, PdfIndirectReference ind, PdfNumber nn) protected PdfArray
branchForm
(Map<String, Object> level, PdfIndirectReference parent, String fname) void
close()
Signals that theDocument
was closed and that no otherElements
will be added.protected void
closeIt()
Creates the new PDF by merging the fields and forms.protected void
(package private) void
createWidgets
(List<Object> list, AcroFields.Item item) protected PdfDictionary
getCatalog
(PdfIndirectReference rootObj) private static String
protected int
getNewObjectNumber
(PdfReader reader, int number, int generation) protected PdfIndirectReference
getPageReference
(int page) Use this method to get a reference to a page existing or not.(package private) RandomAccessFileOrArray
getReaderFile
(PdfReader reader) protected boolean
Checks if a reference refers to a page object.protected boolean
protected boolean
Checks if a reference has already been "visited" in the copy process.(package private) void
mergeField
(String name, AcroFields.Item item) (package private) void
(package private) void
void
openDoc()
private void
protected boolean
Sets a reference to "visited" in the copy process.protected void
updateCalculationOrder
(PdfReader reader) Methods inherited from class com.lowagie.text.pdf.PdfWriter
add, add, add, addAnnotation, addAnnotation, addCalculationOrder, addDeveloperExtension, addDirectImageSimple, addDirectImageSimple, addDirectTemplateSimple, addFileAttachment, addFileAttachment, addFileAttachment, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addLocalDestinations, addNamedDestination, addNamedDestinations, addOCGRadioGroup, addSharedObjectsToBody, addSimple, addSimple, addSimpleExtGState, addSimplePattern, addSimplePatternColorspace, addSimpleProperty, addSimpleShading, addSimpleShadingPattern, addToBody, addToBody, addToBody, addToBody, addToBody, addToBody, addViewerPreference, clearTextWrap, createXmpMetadata, eliminateFontSubset, fillOCProperties, fitsPage, fitsPage, freeReader, getAcroForm, getBoxSize, getColorspaceName, getCompressionLevel, getCurrentDocumentSize, getCurrentPage, getCurrentPageNumber, getDefaultColorspace, getDirectContent, getDirectContentUnder, getEncryption, getExtraCatalog, getGroup, getImageReference, getImportedPage, getIndirectReferenceNumber, getInfo, getInstance, getInstance, getOCProperties, getOs, getPageEvent, getPageNumber, getPageSize, getPdfDocument, getPdfIndirectReference, getPdfVersion, getPDFXConformance, getReferenceJBIG2Globals, getRootOutline, getRunDirection, getSpaceCharRatio, getStructureTreeRoot, getTabs, getUserunit, getVerticalPosition, isFullCompression, isPageEmpty, isPdfA1, isPdfX, isRgbTransparencyBlending, isStrictImageSequence, isTagged, isUserProperties, lockLayer, open, propertyExists, registerLayer, releaseTemplate, reorderPages, resetContent, setAdditionalAction, setAtLeastPdfVersion, setBoxSize, setCollection, setCompressionLevel, setCropBoxSize, setDefaultColorspace, setDuration, setEncryption, setEncryption, setFullCompression, setGroup, setInitialLeading, setLinearPageMode, setOpenAction, setOpenAction, setOutlines, setOutputIntents, setOutputIntents, 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.lowagie.text.DocWriter
add, addTabs, flush, getISOBytes, isCloseStream, isPaused, newPage, pause, resetFooter, resetHeader, resetPageCount, resume, setCloseStream, setFooter, setHeader, setMarginMirroring, setMarginMirroringTopBottom, setMargins, setPageCount, setPageSize, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart
-
Field Details
-
widgetKeys
-
fieldKeys
-
iTextTag
-
zero
-
readers
-
pages2intrefs
-
visited
-
calculationOrder
-
readers2intrefs
Map<PdfReader,IntHashtable> readers2intrefs -
fields
List<AcroFields> fields -
file
-
fieldTree
-
pageRefs
List<PdfIndirectReference> pageRefs -
pageDics
List<PdfDictionary> pageDics -
resources
PdfDictionary resources -
form
PdfDictionary form -
closing
boolean closing -
nd
Document nd -
tabOrder
-
calculationOrderRefs
-
hasSignature
private boolean hasSignature
-
-
Constructor Details
-
PdfCopyFieldsImp
PdfCopyFieldsImp(OutputStream os) throws DocumentException - Throws:
DocumentException
-
PdfCopyFieldsImp
PdfCopyFieldsImp(OutputStream os, char pdfVersion) throws DocumentException - Throws:
DocumentException
-
-
Method Details
-
getCOName
-
addDocument
- Throws:
DocumentException
IOException
-
addDocument
- Throws:
DocumentException
IOException
-
updateCalculationOrder
- Since:
- 2.1.5; before 2.1.5 the method was private
-
propagate
-
adjustTabOrder
-
branchForm
protected PdfArray branchForm(Map<String, Object> 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 interfaceAutoCloseable
- 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
-
isVisited
-
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()
-