DocListener, ElementListener, PdfAnnotations, PdfDocumentActions, PdfEncryptionSettings, PdfPageActions, PdfRunDirection, PdfVersion, PdfViewerPreferences, java.util.EventListenerpublic class PdfAStamperImp extends PdfWriter
PdfWriter.PdfBody, PdfWriter.PdfTrailer| Modifier and Type | Field | Description |
|---|---|---|
protected AcroFields |
acroFields |
|
protected boolean |
append |
|
protected boolean |
closed |
|
protected Counter |
COUNTER |
|
protected boolean |
fieldsAdded |
|
protected java.util.HashSet<PdfTemplate> |
fieldTemplates |
|
protected RandomAccessFileOrArray |
file |
|
protected boolean |
flat |
|
protected boolean |
flatannotations |
|
protected boolean |
flatFreeText |
|
protected int |
initialXrefSize |
|
protected IntHashtable |
marked |
|
protected java.util.HashMap<java.lang.Object,PdfObject> |
namedDestinations |
|
protected int[] |
namePtr |
|
protected PdfAction |
openAction |
|
protected java.util.HashSet<java.lang.String> |
partialFlattening |
|
protected int |
sigFlags |
|
protected boolean |
useVp |
|
protected PdfViewerPreferencesImp |
viewerPreferences |
closeStream, document, EQUALS, FORWARD, GT, LT, NEWLINE, open, os, pageSize, pause, QUOTE, SPACE, TABALLOW_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, colorProfile, 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, extraCatalog, FitWindow, fontNumber, formXObjects, formXObjectsCounter, fullCompression, GENERATION_MAX, group, HideMenubar, HideToolbar, HideWindowUI, imageDictionary, JBIG2Globals, markAll, markInlineElementsOnly, newBookmarks, NO_SPACE_CHAR_RATIO, NonFullScreenPageModeUseNone, NonFullScreenPageModeUseOC, NonFullScreenPageModeUseOutlines, NonFullScreenPageModeUseThumbs, OCGLocked, OCGRadioGroup, OCProperties, originalFileID, PAGE_CLOSE, PAGE_OPEN, pageDictEntries, 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, pdfIsoConformance, PDFX1A2001, PDFX32002, PDFXNONE, prevxref, PrintScalingNone, readerInstances, 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, taggingMode, ttfUnicodeWriter, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, VERSION_1_6, VERSION_1_7, WILL_PRINT, WILL_SAVE, xmpMetadata, xmpWriter| Modifier and Type | Method | Description |
|---|---|---|
void |
addAnnotation(PdfAnnotation annot) |
Use this methods to add a
PdfAnnotation or a PdfFormField
to the document. |
void |
addComments(FdfReader fdf) |
|
protected void |
addFieldResources() |
|
protected void |
addFileAttachments() |
|
void |
addViewerPreference(PdfName key,
PdfObject value) |
Adds a viewer preference
|
protected void |
alterContents() |
|
protected void |
cacheObject(PdfIndirectObject iobj) |
Use this method for caching objects.
|
protected void |
close(java.util.Map<java.lang.String,java.lang.String> moreInfo) |
|
protected void |
close(PdfIndirectReference info,
int skipInfo) |
|
PdfAnnotation |
createAnnotation(float llx,
float lly,
float urx,
float ury,
PdfAction action,
PdfName subtype) |
A wrapper around PdfAnnotation constructor.
|
PdfAnnotation |
createAnnotation(float llx,
float lly,
float urx,
float ury,
PdfString title,
PdfString content,
PdfName subtype) |
A wrapper around PdfAnnotation constructor.
|
PdfAnnotation |
createAnnotation(Rectangle rect,
PdfName subtype) |
A wrapper around PdfAnnotation constructor.
|
void |
createXmpMetadata() |
Use this method to creates XMP Metadata based
on the metadata in the PdfDocument.
|
protected XmpWriter |
createXmpWriter(java.io.ByteArrayOutputStream baos,
PdfDictionary info) |
|
protected XmpWriter |
createXmpWriter(java.io.ByteArrayOutputStream baos,
java.util.HashMap<java.lang.String,java.lang.String> info) |
|
protected void |
flatFields() |
|
protected void |
flatFreeTextFields() |
|
protected void |
flattenAnnotations() |
If setFlatAnnotations is set to true, iText will flatten all annotations with an appearance stream
|
protected Counter |
getCounter() |
|
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.
|
protected java.util.HashMap<java.lang.Object,PdfObject> |
getNamedDestinations() |
|
protected int |
getNewObjectNumber(PdfReader reader,
int number,
int generation) |
|
PdfIndirectReference |
getPageReference(int page) |
Use this method to get a reference to a page existing or not.
|
java.util.Map<java.lang.String,PdfLayer> |
getPdfLayers() |
Gets the PdfLayer objects in an existing document as a Map
with the names/titles of the layers as keys.
|
PdfReader |
getPdfReader() |
|
protected TtfUnicodeWriter |
getTtfUnicodeWriter() |
|
XMPMeta |
getXmpMeta() |
|
protected PdfIsoConformance |
initPdfIsoConformance() |
|
protected void |
markUsed(int num) |
|
protected void |
markUsed(PdfObject obj) |
|
protected void |
readColorProfile() |
|
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) |
If true, annotations with an appearance stream will be flattened.
|
protected void |
setJavaScript() |
|
void |
setOpenAction(PdfAction action) |
When the document opens this
action will be
invoked. |
void |
setOpenAction(java.lang.String name) |
When the document opens it will jump to the destination with
this name.
|
protected void |
setOutlines() |
|
void |
setOutputIntents(java.lang.String outputConditionIdentifier,
java.lang.String outputCondition,
java.lang.String registryName,
java.lang.String info,
ICC_Profile colorProfile) |
Sets the values of the output intent dictionary.
|
void |
setPageAction(PdfName actionType,
PdfAction action) |
Always throws an
UnsupportedOperationException. |
void |
setPDFXConformance(int pdfx) |
Always throws an exception since PDF/X conformance level cannot be set for PDF/A conformant documents.
|
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. |
protected void |
setViewerPreferences() |
|
void |
setViewerPreferences(int preferences) |
Sets the viewer preferences.
|
void |
unRegisterReader(PdfReader reader) |
|
protected void |
updateNamedDestinations() |
add, addTabs, flush, getISOBytes, isCloseStream, isPaused, newPage, pause, resetPageCount, resume, setCloseStream, setMarginMirroring, setMarginMirroringTopBottom, setMargins, setPageCount, setPageSize, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStartclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, addCalculationOrder, addDeveloperExtension, addDirectImageSimple, addDirectImageSimple, addFileAttachment, addFileAttachment, addFileAttachment, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addNamedDestination, addNamedDestinations, addOCGRadioGroup, addPageDictEntry, addSharedObjectsToBody, addToBody, addToBody, addToBody, addToBody, addToBody, addToBody, addXFormsToBody, buildStructTreeRootForTagged, checkElementRole, checkPdfIsoConformance, checkPdfIsoConformance, clearTextWrap, close, fillOCProperties, flushAcroFields, flushTaggedObjects, freeReader, getAcroForm, getBoxSize, getBoxSize, getCatalog, getColorProfile, getCompressionLevel, getCurrentDocumentSize, getCurrentPageNumber, getDefaultColorspace, getExtraCatalog, getGroup, getImportedPage, getIndirectReferenceNumber, getInfo, getInstance, getInstance, getNameString, getOCProperties, getOs, getPageDictEntries, getPageEvent, getPageNumber, getPageSize, getPdfIndirectReference, getPdfReaderInstance, getPDFXConformance, getReferenceJBIG2Globals, getRootOutline, getRunDirection, getSpaceCharRatio, getStandardStructElems, getStructureTreeRoot, getTabs, getVerticalPosition, getXmpWriter, isFullCompression, isPageEmpty, isPdfIso, isPdfX, isRgbTransparencyBlending, isStrictImageSequence, isTagged, isUserProperties, lockLayer, needToBeMarkedInContent, open, releaseTemplate, reorderPages, resetPageDictEntries, setAtLeastPdfVersion, setBoxSize, setCollection, setCompressionLevel, setCropBoxSize, setDefaultColorspace, setEncryption, setEncryption, setEncryption, setEncryption, setEncryption, setFullCompression, setGroup, setInitialLeading, setLanguage, setLinearPageMode, setOutlines, setOutputIntents, setOutputIntents, setPageEmpty, setPageEvent, setPageLabels, setPageViewport, setPageXmpMetadata, setPdfVersion, setPdfVersion, setRgbTransparencyBlending, setRunDirection, setSpaceCharRatio, setStrictImageSequence, setTabs, setTagged, setTagged, setUserProperties, setUserunit, setXmpMetadata, useExternalCacheForTagStructure, writeKeyInfo, writeOutlinesprotected Counter COUNTER
protected RandomAccessFileOrArray file
protected boolean closed
protected AcroFields acroFields
protected boolean flat
protected boolean flatFreeText
protected boolean flatannotations
protected int[] namePtr
protected java.util.HashSet<java.lang.String> partialFlattening
protected boolean useVp
protected PdfViewerPreferencesImp viewerPreferences
protected java.util.HashSet<PdfTemplate> fieldTemplates
protected boolean fieldsAdded
protected int sigFlags
protected boolean append
protected IntHashtable marked
protected int initialXrefSize
protected PdfAction openAction
protected java.util.HashMap<java.lang.Object,PdfObject> namedDestinations
protected void readColorProfile()
public void setOutputIntents(java.lang.String outputConditionIdentifier,
java.lang.String outputCondition,
java.lang.String registryName,
java.lang.String info,
ICC_Profile colorProfile)
throws java.io.IOException
PdfWritersetOutputIntents in class PdfWriteroutputConditionIdentifier - a valueoutputCondition - a valueregistryName - a valueinfo - a valuecolorProfile - a valuejava.io.IOException - on errorPdfWriter.setOutputIntents(String, String, String, String, ICC_Profile)public void setPDFXConformance(int pdfx)
setPDFXConformance in class PdfWriterpdfx - PdfXConformance.setPDFXConformance(int)protected TtfUnicodeWriter getTtfUnicodeWriter()
getTtfUnicodeWriter in class PdfWriterPdfWriter.getTtfUnicodeWriter()protected XmpWriter createXmpWriter(java.io.ByteArrayOutputStream baos, PdfDictionary info) throws java.io.IOException
createXmpWriter in class PdfWriterjava.io.IOExceptionPdfWriter.createXmpWriter(java.io.ByteArrayOutputStream, com.itextpdf.text.pdf.PdfDictionary)protected XmpWriter createXmpWriter(java.io.ByteArrayOutputStream baos, java.util.HashMap<java.lang.String,java.lang.String> info) throws java.io.IOException
createXmpWriter in class PdfWriterjava.io.IOExceptionprotected PdfIsoConformance initPdfIsoConformance()
initPdfIsoConformance in class PdfWriterPdfWriter.initPdfIsoConformance()protected Counter getCounter()
protected void cacheObject(PdfIndirectObject iobj)
PdfWritercacheObject in class PdfWriterPdfIndirectObjectprotected void close(java.util.Map<java.lang.String,java.lang.String> moreInfo)
throws java.io.IOException
java.io.IOExceptionpublic PdfAnnotation createAnnotation(Rectangle rect, PdfName subtype)
PdfWritercreateAnnotation in class PdfWriterpublic PdfAnnotation createAnnotation(float llx, float lly, float urx, float ury, PdfString title, PdfString content, PdfName subtype)
PdfWritercreateAnnotation in class PdfWriterpublic PdfAnnotation createAnnotation(float llx, float lly, float urx, float ury, PdfAction action, PdfName subtype)
PdfWritercreateAnnotation in class PdfWriterpublic XMPMeta getXmpMeta()
protected void setViewerPreferences()
protected void close(PdfIndirectReference info, int skipInfo) throws java.io.IOException
java.io.IOExceptionprotected void alterContents()
throws java.io.IOException
java.io.IOExceptionprotected int getNewObjectNumber(PdfReader reader, int number, int generation)
getNewObjectNumber in class PdfWriterpublic void registerReader(PdfReader reader, boolean openFile) throws java.io.IOException
reader - openFile - java.io.IOExceptionpublic void unRegisterReader(PdfReader reader)
reader - public void addComments(FdfReader fdf) throws java.io.IOException
fdf - java.io.IOExceptionprotected void flatFields()
public void setFlatAnnotations(boolean flatAnnotations)
flatAnnotations - booleanprotected 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.itextpdf.text.pdf.PdfAnnotation)protected void addFieldResources()
throws java.io.IOException
java.io.IOExceptionprotected void setJavaScript()
throws java.io.IOException
java.io.IOExceptionprotected void addFileAttachments()
throws java.io.IOException
java.io.IOExceptionprotected void setOutlines()
throws java.io.IOException
java.io.IOExceptionpublic 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.itextpdf.text.pdf.PdfName, com.itextpdf.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.itextpdf.text.pdf.PdfTransition)protected void markUsed(PdfObject obj)
protected void markUsed(int num)
public PdfReader getPdfReader()
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.itextpdf.text.pdf.PdfName, com.itextpdf.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.itextpdf.text.pdf.PdfAction)public void setOpenAction(java.lang.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.itextpdf.text.Image)public PdfContentByte getDirectContentUnder()
PdfWritergetDirectContentUnder in class PdfWriterpublic PdfContentByte getDirectContent()
PdfWritergetDirectContent in class PdfWriterprotected void readOCProperties()
public java.util.Map<java.lang.String,PdfLayer> getPdfLayers()
public void createXmpMetadata()
PdfWritercreateXmpMetadata in class PdfWriterprotected java.util.HashMap<java.lang.Object,PdfObject> getNamedDestinations()
protected void updateNamedDestinations()
throws java.io.IOException
java.io.IOExceptionCopyright © 1998–2018. All rights reserved.