public class PdfStamperImp extends PdfWriter
PdfWriter.PdfBody| Modifier and Type | Field and Description |
|---|---|
protected AcroFields |
acroFields |
protected boolean |
append |
protected boolean |
fieldsAdded |
protected HashMap |
fieldTemplates |
protected boolean |
flat |
protected boolean |
flatAnnotations |
protected boolean |
flatFreeText |
protected int |
initialXrefSize |
protected IntHashtable |
marked |
protected int[] |
namePtr |
protected PdfAction |
openAction |
protected HashSet |
partialFlattening |
protected int |
sigFlags |
protected boolean |
useVp |
protected PdfViewerPreferencesImp |
viewerPreferences |
ALLOW_ASSEMBLY, ALLOW_COPY, ALLOW_DEGRADED_PRINTING, ALLOW_FILL_IN, ALLOW_MODIFY_ANNOTATIONS, ALLOW_MODIFY_CONTENTS, ALLOW_PRINTING, ALLOW_SCREENREADERS, AllowAssembly, AllowCopy, AllowDegradedPrinting, AllowFillIn, AllowModifyAnnotations, AllowModifyContents, AllowPrinting, AllowScreenReaders, 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, 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, STRENGTH128BITS, STRENGTH40BITS, 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| Modifier | Constructor and Description |
|---|---|
protected |
PdfStamperImp(PdfReader reader,
OutputStream os,
char pdfVersion,
boolean append)
Creates new PdfStamperImp.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotation(PdfAnnotation annot)
Use this methods to add a
PdfAnnotation or a PdfFormField
to the document. |
void |
addComments(FdfReader fdf) |
void |
addViewerPreference(PdfName key,
PdfObject value)
Adds a viewer preference
|
protected void |
close(HashMap moreInfo) |
protected void |
flatFreeTextFields() |
protected void |
flattenAnnotations() |
protected AcroFields |
getAcroFields() |
PdfContentByte |
getDirectContent()
Use this method to get the direct content for this document.
|
PdfContentByte |
getDirectContentUnder()
Use this method to get the direct content under for this document.
|
Calendar |
getModificationDate() |
protected int |
getNewObjectNumber(PdfReader reader,
int number,
int generation) |
protected PdfContentByte |
getOverContent(int pageNum) |
PdfObject |
getOverrideFileId() |
PdfIndirectReference |
getPageReference(int page)
Use this method to get a reference to a page existing or not.
|
Map |
getPdfLayers()
Gets the PdfLayer objects in an existing document as a Map
with the names/titles of the layers as keys.
|
protected PdfContentByte |
getUnderContent(int pageNum) |
boolean |
isIncludeFileID() |
protected void |
markUsed(int num) |
protected void |
markUsed(PdfObject obj) |
protected void |
readOCProperties()
Reads the OCProperties dictionary from the catalog of the existing document
and fills the documentOCG, documentOCGorder and OCGRadioGroup variables in PdfWriter.
|
void |
registerReader(PdfReader reader,
boolean openFile) |
void |
setAdditionalAction(PdfName actionType,
PdfAction action)
Additional-actions defining the actions to be taken in
response to various trigger events affecting the document
as a whole.
|
void |
setDuration(int seconds)
Always throws an
UnsupportedOperationException. |
void |
setFlatAnnotations(boolean flatAnnotations) |
protected void |
setFormFlattening(boolean flat) |
void |
setIncludeFileID(boolean includeFileID) |
void |
setModificationDate(Calendar modificationDate) |
void |
setOpenAction(PdfAction action)
When the document opens this
action will be
invoked. |
void |
setOpenAction(String name)
When the document opens it will jump to the destination with
this name.
|
void |
setOverrideFileId(PdfObject overrideFileId) |
void |
setPageAction(PdfName actionType,
PdfAction action)
Always throws an
UnsupportedOperationException. |
void |
setSigFlags(int f)
Set the signature flags.
|
void |
setThumbnail(Image image)
Use this method to set the thumbnail image for the current page.
|
void |
setTransition(PdfTransition transition)
Always throws an
UnsupportedOperationException. |
void |
setViewerPreferences(int preferences)
Sets the viewer preferences.
|
void |
unRegisterReader(PdfReader reader) |
add, addCalculationOrder, addDeveloperExtension, addDirectImageSimple, addDirectImageSimple, addFileAttachment, addFileAttachment, addFileAttachment, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addOCGRadioGroup, addSharedObjectsToBody, addToBody, addToBody, addToBody, addToBody, addToBody, addToBody, clearTextWrap, close, createXmpMetadata, fillOCProperties, fitsPage, fitsPage, freeReader, getAcroForm, getBoxSize, getCatalog, getCompressionLevel, getCurrentDocumentSize, getCurrentPageNumber, getDefaultColorspace, getExtraCatalog, getGroup, getImportedPage, getInfo, getInstance, getInstance, getOCProperties, getPageEvent, getPageNumber, getPageSize, getPdfIndirectReference, getPDFXConformance, getReferenceJBIG2Globals, getRootOutline, getRunDirection, getSpaceCharRatio, getStructureTreeRoot, getTabs, getUserunit, getVerticalPosition, isFullCompression, isPageEmpty, isPdfX, isRgbTransparencyBlending, isStrictImageSequence, isTagged, isUserProperties, lockLayer, open, releaseTemplate, reorderPages, setAtLeastPdfVersion, setBoxSize, setCollection, setCompressionLevel, setCropBoxSize, setDefaultColorspace, setEncryption, setEncryption, setEncryption, setEncryption, setEncryption, setFullCompression, setGroup, setInitialLeading, setLinearPageMode, setOutlines, setOutputIntents, setOutputIntents, setOutputIntents, setPageEmpty, setPageEvent, setPageLabels, setPageXmpMetadata, setPdfVersion, setPdfVersion, setPDFXConformance, setRgbTransparencyBlending, setRunDirection, setSpaceCharRatio, setStrictImageSequence, setTabs, setTagged, setUserProperties, setUserunit, setXmpMetadata, writeOutlinesadd, addTabs, flush, getISOBytes, isCloseStream, isPaused, newPage, pause, resetFooter, resetHeader, resetPageCount, resume, setCloseStream, setFooter, setHeader, setMarginMirroring, setMarginMirroringTopBottom, setMargins, setPageCount, setPageSize, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStartprotected AcroFields acroFields
protected boolean flat
protected boolean flatFreeText
protected boolean flatAnnotations
protected int[] namePtr
protected HashSet partialFlattening
protected boolean useVp
protected PdfViewerPreferencesImp viewerPreferences
protected HashMap fieldTemplates
protected boolean fieldsAdded
protected int sigFlags
protected boolean append
protected IntHashtable marked
protected int initialXrefSize
protected PdfAction openAction
protected PdfStamperImp(PdfReader reader, OutputStream os, char pdfVersion, boolean append) throws DocumentException, IOException
reader - the read PDFos - the output destinationpdfVersion - the new pdf version or '\0' to keep the same version as the original
documentappend - DocumentException - on errorIOExceptionprotected void close(HashMap moreInfo) throws IOException
IOExceptionprotected int getNewObjectNumber(PdfReader reader, int number, int generation)
getNewObjectNumber in class PdfWriterpublic void registerReader(PdfReader reader, boolean openFile) throws IOException
reader - openFile - IOExceptionpublic void unRegisterReader(PdfReader reader)
reader - public void addComments(FdfReader fdf) throws IOException
fdf - IOExceptionprotected PdfContentByte getUnderContent(int pageNum)
protected PdfContentByte getOverContent(int pageNum)
protected AcroFields getAcroFields()
protected void setFormFlattening(boolean flat)
public void setFlatAnnotations(boolean flatAnnotations)
protected void flattenAnnotations()
protected void flatFreeTextFields()
public PdfIndirectReference getPageReference(int page)
PdfWritergetPageReference in class PdfWriterpage - the page number. The first page is 1PdfWriter.getPageReference(int)public void addAnnotation(PdfAnnotation annot)
PdfAnnotationsPdfAnnotation or a PdfFormField
to the document. Only the top parent of a PdfFormField
needs to be added.addAnnotation in interface PdfAnnotationsaddAnnotation in class PdfWriterannot - the PdfAnnotation or the PdfFormField to addPdfWriter.addAnnotation(com.lowagie.text.pdf.PdfAnnotation)public void setViewerPreferences(int preferences)
setViewerPreferences in interface PdfViewerPreferencessetViewerPreferences in class PdfWriterpreferences - the viewer preferencesPdfWriter.setViewerPreferences(int)public void addViewerPreference(PdfName key, PdfObject value)
addViewerPreference in interface PdfViewerPreferencesaddViewerPreference in class PdfWriterkey - a key for a viewer preferencevalue - the value for the viewer preferencePdfViewerPreferences.addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)public void setSigFlags(int f)
setSigFlags in interface PdfAnnotationssetSigFlags in class PdfWriterf - the flags. This flags are ORed with current onesPdfAnnotations.setSigFlags(int)public void setPageAction(PdfName actionType, PdfAction action) throws PdfException
UnsupportedOperationException.setPageAction in interface PdfPageActionssetPageAction in class PdfWriteractionType - ignoreaction - ignorePdfException - ignorePdfStamper.setPageAction(PdfName, PdfAction, int)public void setDuration(int seconds)
UnsupportedOperationException.setDuration in interface PdfPageActionssetDuration in class PdfWriterseconds - ignorePdfPageActions.setDuration(int)public void setTransition(PdfTransition transition)
UnsupportedOperationException.setTransition in interface PdfPageActionssetTransition in class PdfWritertransition - ignorePdfPageActions.setTransition(com.lowagie.text.pdf.PdfTransition)protected void markUsed(PdfObject obj)
protected void markUsed(int num)
public void setAdditionalAction(PdfName actionType, PdfAction action) throws PdfException
DOCUMENT_CLOSE,
WILL_SAVE, DID_SAVE, WILL_PRINT
and DID_PRINT.setAdditionalAction in interface PdfDocumentActionssetAdditionalAction in class PdfWriteractionType - the action typeaction - the action to execute in response to the triggerPdfException - on invalid action typePdfDocumentActions.setAdditionalAction(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfAction)public void setOpenAction(PdfAction action)
PdfDocumentActionsaction will be
invoked.setOpenAction in interface PdfDocumentActionssetOpenAction in class PdfWriteraction - the action to be invokedPdfWriter.setOpenAction(com.lowagie.text.pdf.PdfAction)public void setOpenAction(String name)
PdfDocumentActionssetOpenAction in interface PdfDocumentActionssetOpenAction in class PdfWritername - the name of the destination to jump toPdfWriter.setOpenAction(java.lang.String)public void setThumbnail(Image image)
PdfWritersetThumbnail in class PdfWriterimage - the imagePdfWriter.setThumbnail(com.lowagie.text.Image)public PdfContentByte getDirectContentUnder()
PdfWritergetDirectContentUnder in class PdfWriterpublic PdfContentByte getDirectContent()
PdfWritergetDirectContent in class PdfWriterprotected void readOCProperties()
public Map getPdfLayers()
public boolean isIncludeFileID()
public void setIncludeFileID(boolean includeFileID)
public PdfObject getOverrideFileId()
public void setOverrideFileId(PdfObject overrideFileId)
public Calendar getModificationDate()
public void setModificationDate(Calendar modificationDate)
Copyright © 2024. All rights reserved.