Package org.openpdf.text.pdf
Class PdfCopyFieldsImp
java.lang.Object
org.openpdf.text.DocWriter
org.openpdf.text.pdf.PdfWriter
org.openpdf.text.pdf.PdfCopyFieldsImp
- All Implemented Interfaces:
AutoCloseable,EventListener,DocListener,ElementListener,PdfAnnotations,PdfDocumentActions,PdfEncryptionSettings,PdfPageActions,PdfRunDirection,PdfVersion,PdfViewerPreferences,PdfXConformance
- Direct Known Subclasses:
PdfCopyFormsImp
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openpdf.text.pdf.PdfWriter
PdfWriter.PdfBody, PdfWriter.PdfTrailer -
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean(package private) List<AcroFields>(package private) RandomAccessFileOrArray(package private) PdfDictionaryprivate booleanprivate 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) PdfDictionaryprivate final Map<PdfReader,IntHashtable> private static final IntegerFields inherited from class org.openpdf.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) voidaddDocument(PdfReader reader) (package private) voidaddDocument(PdfReader reader, List<Integer> pagesToKeep) (package private) voidaddPageOffsetToField(Map<String, AcroFields.Item> fd, int pageOffset) private voidadjustTabOrder(PdfArray annots, PdfIndirectReference ind, PdfNumber nn) protected PdfArraybranchForm(Map<String, Object> level, PdfIndirectReference parent, String fname) voidclose()Signals that theDocumentwas closed and that no otherElementswill be added.protected voidcloseIt()Creates the new PDF by merging the fields and forms.protected void(package private) voidcreateWidgets(List<Object> list, AcroFields.Item item) protected PdfDictionarygetCatalog(PdfIndirectReference rootObj) private static Stringprotected intgetNewObjectNumber(PdfReader reader, int number, int generation) protected PdfIndirectReferencegetPageReference(int page) Use this method to get a reference to a page existing or not.(package private) RandomAccessFileOrArraygetReaderFile(PdfReader reader) protected booleanChecks if a reference refers to a page object.protected booleanprotected booleanChecks if a reference has already been "visited" in the copy process.(package private) voidmergeField(String name, AcroFields.Item item) (package private) void(package private) voidvoidopenDoc()private voidprotected booleanSets a reference to "visited" in the copy process.protected voidupdateCalculationOrder(PdfReader reader) Methods inherited from class org.openpdf.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, writeOutlinesMethods inherited from class org.openpdf.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:
DocumentExceptionIOException
-
addDocument
- Throws:
DocumentExceptionIOException
-
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: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 interfaceAutoCloseable- 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
-
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:
getReaderFilein classPdfWriter
-
openDoc
public void openDoc()
-