Class PdfStamperImp
java.lang.Object
com.aowagie.text.DocWriter
com.aowagie.text.pdf.PdfWriter
com.aowagie.text.pdf.PdfStamperImp
- All Implemented Interfaces:
DocListener, ElementListener, PdfAnnotations, PdfDocumentActions, PdfEncryptionSettings, PdfPageActions, PdfRunDirection, PdfVersion, PdfViewerPreferences, PdfXConformance, EventListener
-
Field Summary
Fields inherited from class PdfWriter
body, CenterWindow, compressionLevel, crypto, currentPdfReaderInstance, DirectionL2R, DirectionR2L, DisplayDocTitle, documentOCG, FitWindow, fullCompression, 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, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, VERSION_1_6, VERSION_1_7, xmpMetadata -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(PdfAnnotation annot) Use this methods to add aPdfAnnotationor aPdfFormFieldto the document.voidaddViewerPreference(PdfName key, PdfObject value) Adds a viewer preferenceUse this method to get the direct content for this document.Use this method to get the direct content under for this document.protected intgetNewObjectNumber(PdfReader reader, int number, int generation) getPageReference(int page) Use this method to get a reference to a page existing or not.Gets the PdfLayer objects in an existing document as a Map with the names/titles of the layers as keys.protected voidvoidsetAdditionalAction(PdfName actionType, PdfAction action) Additional-actions defining the actions to be taken in response to various trigger events affecting the document as a whole.voidsetDuration(int seconds) Always throws anUnsupportedOperationException.voidsetOpenAction(PdfAction action) When the document opens thisactionwill be invoked.voidsetOpenAction(String name) When the document opens it will jump to the destination with this name.voidsetPageAction(PdfName actionType, PdfAction action) Always throws anUnsupportedOperationException.voidsetSigFlags(int f) Set the signature flags.voidsetThumbnail(Image image) Use this method to set the thumbnail image for the current page.voidsetTransition(PdfTransition transition) Always throws anUnsupportedOperationException.voidsetViewerPreferences(int preferences) Sets the viewer preferences.Methods inherited from class PdfWriter
addDeveloperExtension, addFileAttachment, addSharedObjectsToBody, addToBody, addToBody, close, createXmpMetadata, fillOCProperties, freeReader, getAcroForm, getCatalog, getCompressionLevel, getCurrentDocumentSize, getCurrentPageNumber, getDefaultColorspace, getExtraCatalog, getGroup, getImportedPage, getInfo, getInstance, getOCProperties, getPageEvent, getPageNumber, getPageSize, getPdfIndirectReference, getPDFXConformance, getReferenceJBIG2Globals, getRootOutline, getRunDirection, getSpaceCharRatio, getStructureTreeRoot, getTabs, getUserunit, isFullCompression, isPdfX, isRgbTransparencyBlending, isStrictImageSequence, isTagged, isUserProperties, open, setAtLeastPdfVersion, setCollection, setCompressionLevel, setCropBoxSize, setEncryption, setEncryption, setGroup, setInitialLeading, setOutlines, setOutputIntents, setPageEmpty, setPageEvent, setPageLabels, setPageXmpMetadata, setPdfVersion, setPdfVersion, setPDFXConformance, setRgbTransparencyBlending, setRunDirection, setSpaceCharRatio, setStrictImageSequence, setTabs, setTagged, setUserProperties, setUserunit, setXmpMetadata, writeOutlinesMethods inherited from class DocWriter
add, getISOBytes, isCloseStream, isPaused, newPage, resetFooter, resetHeader, resetPageCount, setCloseStream, setFooter, setHeader, setMarginMirroring, setMarginMirroringTopBottom, setMargins, setPageCount, setPageSize
-
Method Details
-
getNewObjectNumber
- Overrides:
getNewObjectNumberin classPdfWriter
-
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
- See Also:
-
addAnnotation
Description copied from interface:PdfAnnotationsUse this methods to add aPdfAnnotationor aPdfFormFieldto the document. Only the top parent of aPdfFormFieldneeds to be added.- Specified by:
addAnnotationin interfacePdfAnnotations- Overrides:
addAnnotationin classPdfWriter- Parameters:
annot- thePdfAnnotationor thePdfFormFieldto add- See Also:
-
setViewerPreferences
public void setViewerPreferences(int preferences) Sets the viewer preferences.- Specified by:
setViewerPreferencesin interfacePdfViewerPreferences- Overrides:
setViewerPreferencesin classPdfWriter- Parameters:
preferences- the viewer preferences- See Also:
-
addViewerPreference
Adds a viewer preference- Specified by:
addViewerPreferencein interfacePdfViewerPreferences- Overrides:
addViewerPreferencein classPdfWriter- Parameters:
key- a key for a viewer preferencevalue- the value for the viewer preference- See Also:
-
setSigFlags
public void setSigFlags(int f) Set the signature flags.- Specified by:
setSigFlagsin interfacePdfAnnotations- Overrides:
setSigFlagsin classPdfWriter- Parameters:
f- the flags. This flags are ORed with current ones- See Also:
-
setPageAction
public void setPageAction(PdfName actionType, PdfAction action) throws com.aowagie.text.pdf.PdfException Always throws anUnsupportedOperationException.- Overrides:
setPageActionin classPdfWriter- Parameters:
actionType- ignoreaction- ignore- Throws:
com.aowagie.text.pdf.PdfException- ignore
-
setDuration
public void setDuration(int seconds) Always throws anUnsupportedOperationException.- Specified by:
setDurationin interfacePdfPageActions- Overrides:
setDurationin classPdfWriter- Parameters:
seconds- ignore- See Also:
-
setTransition
Always throws anUnsupportedOperationException.- Specified by:
setTransitionin interfacePdfPageActions- Overrides:
setTransitionin classPdfWriter- Parameters:
transition- ignore- See Also:
-
markUsed
-
setAdditionalAction
public void setAdditionalAction(PdfName actionType, PdfAction action) throws com.aowagie.text.pdf.PdfException Additional-actions defining the actions to be taken in response to various trigger events affecting the document as a whole. The actions types allowed are:DOCUMENT_CLOSE,WILL_SAVE,DID_SAVE,WILL_PRINTandDID_PRINT.- Overrides:
setAdditionalActionin classPdfWriter- Parameters:
actionType- the action typeaction- the action to execute in response to the trigger- Throws:
com.aowagie.text.pdf.PdfException- on invalid action type
-
setOpenAction
Description copied from interface:PdfDocumentActionsWhen the document opens thisactionwill be invoked.- Specified by:
setOpenActionin interfacePdfDocumentActions- Overrides:
setOpenActionin classPdfWriter- Parameters:
action- the action to be invoked- See Also:
-
setOpenAction
Description copied from interface:PdfDocumentActionsWhen the document opens it will jump to the destination with this name.- Specified by:
setOpenActionin interfacePdfDocumentActions- Overrides:
setOpenActionin classPdfWriter- Parameters:
name- the name of the destination to jump to- See Also:
-
setThumbnail
Description copied from class:PdfWriterUse this method to set the thumbnail image for the current page.- Overrides:
setThumbnailin classPdfWriter- Parameters:
image- the image- See Also:
-
getDirectContentUnder
Description copied from class:PdfWriterUse this method to get the direct content under for this document. There is only one direct content, multiple calls to this method will always retrieve the same object.- Overrides:
getDirectContentUnderin classPdfWriter- Returns:
- the direct content
-
getDirectContent
Description copied from class:PdfWriterUse this method to get the direct content for this document. There is only one direct content, multiple calls to this method will allways retrieve the same object.- Overrides:
getDirectContentin classPdfWriter- Returns:
- the direct content
-
getPdfLayers
Gets the PdfLayer objects in an existing document as a Map with the names/titles of the layers as keys.- Returns:
- a Map with all the PdfLayers in the document (and the name/title of the layer as key)
- Since:
- 2.1.2
-
getFileID
-