Class PdfAStamperImp

java.lang.Object
com.itextpdf.text.DocWriter
com.itextpdf.text.pdf.PdfWriter
com.itextpdf.text.pdf.PdfAStamperImp
All Implemented Interfaces:
com.itextpdf.text.DocListener, com.itextpdf.text.ElementListener, com.itextpdf.text.pdf.interfaces.PdfAnnotations, com.itextpdf.text.pdf.interfaces.PdfDocumentActions, com.itextpdf.text.pdf.interfaces.PdfEncryptionSettings, com.itextpdf.text.pdf.interfaces.PdfPageActions, com.itextpdf.text.pdf.interfaces.PdfRunDirection, com.itextpdf.text.pdf.interfaces.PdfVersion, com.itextpdf.text.pdf.interfaces.PdfViewerPreferences, EventListener

public class PdfAStamperImp extends com.itextpdf.text.pdf.PdfWriter
Extension to PdfStamperImp that will attempt to keep a file in conformance with the PDF/A standard.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.itextpdf.text.pdf.PdfWriter

    com.itextpdf.text.pdf.PdfWriter.PdfBody, com.itextpdf.text.pdf.PdfWriter.PdfTrailer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.itextpdf.text.pdf.AcroFields
     
    protected boolean
     
    protected boolean
     
    protected com.itextpdf.text.log.Counter
     
    protected boolean
     
    protected HashSet<com.itextpdf.text.pdf.PdfTemplate>
     
    protected com.itextpdf.text.pdf.RandomAccessFileOrArray
     
    protected boolean
     
    protected boolean
     
    protected boolean
     
    protected int
     
    protected com.itextpdf.text.pdf.IntHashtable
     
    protected HashMap<Object,com.itextpdf.text.pdf.PdfObject>
     
    protected int[]
     
    protected com.itextpdf.text.pdf.PdfAction
     
    protected HashSet<String>
     
    protected int
     
    protected boolean
     
    protected com.itextpdf.text.pdf.internal.PdfViewerPreferencesImp
     

    Fields inherited from class com.itextpdf.text.pdf.PdfWriter

    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, 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

    Fields inherited from class com.itextpdf.text.DocWriter

    closeStream, document, EQUALS, FORWARD, GT, LT, NEWLINE, open, os, pageSize, pause, QUOTE, SPACE, TAB
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAnnotation(com.itextpdf.text.pdf.PdfAnnotation arg0)
     
    void
    addComments(com.itextpdf.text.pdf.FdfReader arg0)
     
    protected void
     
    protected void
     
    void
    addViewerPreference(com.itextpdf.text.pdf.PdfName arg0, com.itextpdf.text.pdf.PdfObject arg1)
     
    protected void
     
    protected void
    cacheObject(com.itextpdf.text.pdf.PdfIndirectObject iobj)
     
    protected void
    close(com.itextpdf.text.pdf.PdfIndirectReference arg0, int arg1)
     
    protected void
    close(Map<String,String> moreInfo)
     
    com.itextpdf.text.pdf.PdfAnnotation
    createAnnotation(float llx, float lly, float urx, float ury, com.itextpdf.text.pdf.PdfAction action, com.itextpdf.text.pdf.PdfName subtype)
     
    com.itextpdf.text.pdf.PdfAnnotation
    createAnnotation(float llx, float lly, float urx, float ury, com.itextpdf.text.pdf.PdfString title, com.itextpdf.text.pdf.PdfString content, com.itextpdf.text.pdf.PdfName subtype)
     
    com.itextpdf.text.pdf.PdfAnnotation
    createAnnotation(com.itextpdf.text.Rectangle rect, com.itextpdf.text.pdf.PdfName subtype)
     
    void
     
    protected com.itextpdf.text.xml.xmp.XmpWriter
    createXmpWriter(ByteArrayOutputStream baos, com.itextpdf.text.pdf.PdfDictionary info)
     
    protected com.itextpdf.text.xml.xmp.XmpWriter
     
    protected void
     
    protected void
     
    protected void
     
    protected com.itextpdf.text.log.Counter
     
    com.itextpdf.text.pdf.PdfContentByte
     
    com.itextpdf.text.pdf.PdfContentByte
     
    protected HashMap<Object,com.itextpdf.text.pdf.PdfObject>
     
    protected int
    getNewObjectNumber(com.itextpdf.text.pdf.PdfReader arg0, int arg1, int arg2)
     
    com.itextpdf.text.pdf.PdfIndirectReference
    getPageReference(int arg0)
     
    Map<String,com.itextpdf.text.pdf.PdfLayer>
     
    com.itextpdf.text.pdf.PdfReader
     
    protected com.itextpdf.text.pdf.TtfUnicodeWriter
     
    protected com.itextpdf.text.pdf.interfaces.PdfIsoConformance
     
    protected void
    markUsed(int arg0)
     
    protected void
    markUsed(com.itextpdf.text.pdf.PdfObject arg0)
     
    protected void
     
    protected void
     
    void
    registerReader(com.itextpdf.text.pdf.PdfReader arg0, boolean arg1)
     
    void
    setAdditionalAction(com.itextpdf.text.pdf.PdfName arg0, com.itextpdf.text.pdf.PdfAction arg1)
     
    void
    setDuration(int arg0)
     
    void
    setFlatAnnotations(boolean arg0)
     
    protected void
     
    void
    setOpenAction(com.itextpdf.text.pdf.PdfAction arg0)
     
    void
     
    protected void
     
    void
    setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, com.itextpdf.text.pdf.ICC_Profile colorProfile)
     
    void
    setPageAction(com.itextpdf.text.pdf.PdfName arg0, com.itextpdf.text.pdf.PdfAction arg1)
     
    void
    Always throws an exception since PDF/X conformance level cannot be set for PDF/A conformant documents.
    void
    setSigFlags(int arg0)
     
    void
    setThumbnail(com.itextpdf.text.Image arg0)
     
    void
    setTransition(com.itextpdf.text.pdf.PdfTransition arg0)
     
    protected void
     
    void
     
    void
    unRegisterReader(com.itextpdf.text.pdf.PdfReader arg0)
     
    protected void
     

    Methods inherited from class com.itextpdf.text.pdf.PdfWriter

    add, 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, writeOutlines

    Methods inherited from class com.itextpdf.text.DocWriter

    add, addTabs, flush, getISOBytes, isCloseStream, isPaused, newPage, pause, resetPageCount, resume, setCloseStream, setMarginMirroring, setMarginMirroringTopBottom, setMargins, setPageCount, setPageSize, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • COUNTER

      protected com.itextpdf.text.log.Counter COUNTER
    • file

      protected com.itextpdf.text.pdf.RandomAccessFileOrArray file
    • closed

      protected boolean closed
    • acroFields

      protected com.itextpdf.text.pdf.AcroFields acroFields
    • flat

      protected boolean flat
    • flatFreeText

      protected boolean flatFreeText
    • flatannotations

      protected boolean flatannotations
    • namePtr

      protected int[] namePtr
    • partialFlattening

      protected HashSet<String> partialFlattening
    • useVp

      protected boolean useVp
    • viewerPreferences

      protected com.itextpdf.text.pdf.internal.PdfViewerPreferencesImp viewerPreferences
    • fieldTemplates

      protected HashSet<com.itextpdf.text.pdf.PdfTemplate> fieldTemplates
    • fieldsAdded

      protected boolean fieldsAdded
    • sigFlags

      protected int sigFlags
    • append

      protected boolean append
    • marked

      protected com.itextpdf.text.pdf.IntHashtable marked
    • initialXrefSize

      protected int initialXrefSize
    • openAction

      protected com.itextpdf.text.pdf.PdfAction openAction
    • namedDestinations

      protected HashMap<Object,com.itextpdf.text.pdf.PdfObject> namedDestinations
  • Method Details

    • readColorProfile

      protected void readColorProfile()
    • setOutputIntents

      public void setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, com.itextpdf.text.pdf.ICC_Profile colorProfile) throws IOException
      Overrides:
      setOutputIntents in class com.itextpdf.text.pdf.PdfWriter
      Throws:
      IOException
      See Also:
      • PdfWriter.setOutputIntents(String, String, String, String, ICC_Profile)
    • setPDFXConformance

      public void setPDFXConformance(int pdfx)
      Always throws an exception since PDF/X conformance level cannot be set for PDF/A conformant documents.
      Overrides:
      setPDFXConformance in class com.itextpdf.text.pdf.PdfWriter
      Parameters:
      pdfx -
    • getTtfUnicodeWriter

      protected com.itextpdf.text.pdf.TtfUnicodeWriter getTtfUnicodeWriter()
      Overrides:
      getTtfUnicodeWriter in class com.itextpdf.text.pdf.PdfWriter
      See Also:
      • PdfWriter.getTtfUnicodeWriter()
    • createXmpWriter

      protected com.itextpdf.text.xml.xmp.XmpWriter createXmpWriter(ByteArrayOutputStream baos, com.itextpdf.text.pdf.PdfDictionary info) throws IOException
      Overrides:
      createXmpWriter in class com.itextpdf.text.pdf.PdfWriter
      Throws:
      IOException
      See Also:
      • PdfWriter.createXmpWriter(java.io.ByteArrayOutputStream, com.itextpdf.text.pdf.PdfDictionary)
    • createXmpWriter

      protected com.itextpdf.text.xml.xmp.XmpWriter createXmpWriter(ByteArrayOutputStream baos, HashMap<String,String> info) throws IOException
      Overrides:
      createXmpWriter in class com.itextpdf.text.pdf.PdfWriter
      Throws:
      IOException
    • initPdfIsoConformance

      protected com.itextpdf.text.pdf.interfaces.PdfIsoConformance initPdfIsoConformance()
      Overrides:
      initPdfIsoConformance in class com.itextpdf.text.pdf.PdfWriter
      See Also:
      • PdfWriter.initPdfIsoConformance()
    • getCounter

      protected com.itextpdf.text.log.Counter getCounter()
    • cacheObject

      protected void cacheObject(com.itextpdf.text.pdf.PdfIndirectObject iobj)
      Overrides:
      cacheObject in class com.itextpdf.text.pdf.PdfWriter
    • close

      protected void close(Map<String,String> moreInfo) throws IOException
      Throws:
      IOException
    • createAnnotation

      public com.itextpdf.text.pdf.PdfAnnotation createAnnotation(com.itextpdf.text.Rectangle rect, com.itextpdf.text.pdf.PdfName subtype)
      Overrides:
      createAnnotation in class com.itextpdf.text.pdf.PdfWriter
    • createAnnotation

      public com.itextpdf.text.pdf.PdfAnnotation createAnnotation(float llx, float lly, float urx, float ury, com.itextpdf.text.pdf.PdfString title, com.itextpdf.text.pdf.PdfString content, com.itextpdf.text.pdf.PdfName subtype)
      Overrides:
      createAnnotation in class com.itextpdf.text.pdf.PdfWriter
    • createAnnotation

      public com.itextpdf.text.pdf.PdfAnnotation createAnnotation(float llx, float lly, float urx, float ury, com.itextpdf.text.pdf.PdfAction action, com.itextpdf.text.pdf.PdfName subtype)
      Overrides:
      createAnnotation in class com.itextpdf.text.pdf.PdfWriter
    • setViewerPreferences

      protected void setViewerPreferences()
    • close

      protected void close(com.itextpdf.text.pdf.PdfIndirectReference arg0, int arg1) throws IOException
      Throws:
      IOException
    • alterContents

      protected void alterContents() throws IOException
      Throws:
      IOException
    • getNewObjectNumber

      protected int getNewObjectNumber(com.itextpdf.text.pdf.PdfReader arg0, int arg1, int arg2)
      Overrides:
      getNewObjectNumber in class com.itextpdf.text.pdf.PdfWriter
    • registerReader

      public void registerReader(com.itextpdf.text.pdf.PdfReader arg0, boolean arg1) throws IOException
      Throws:
      IOException
    • unRegisterReader

      public void unRegisterReader(com.itextpdf.text.pdf.PdfReader arg0)
    • addComments

      public void addComments(com.itextpdf.text.pdf.FdfReader arg0) throws IOException
      Throws:
      IOException
    • flatFields

      protected void flatFields()
    • setFlatAnnotations

      public void setFlatAnnotations(boolean arg0)
    • flattenAnnotations

      protected void flattenAnnotations()
    • flatFreeTextFields

      protected void flatFreeTextFields()
    • getPageReference

      public com.itextpdf.text.pdf.PdfIndirectReference getPageReference(int arg0)
      Overrides:
      getPageReference in class com.itextpdf.text.pdf.PdfWriter
    • addAnnotation

      public void addAnnotation(com.itextpdf.text.pdf.PdfAnnotation arg0)
      Specified by:
      addAnnotation in interface com.itextpdf.text.pdf.interfaces.PdfAnnotations
      Overrides:
      addAnnotation in class com.itextpdf.text.pdf.PdfWriter
    • addFieldResources

      protected void addFieldResources() throws IOException
      Throws:
      IOException
    • setJavaScript

      protected void setJavaScript() throws IOException
      Throws:
      IOException
    • addFileAttachments

      protected void addFileAttachments() throws IOException
      Throws:
      IOException
    • setOutlines

      protected void setOutlines() throws IOException
      Throws:
      IOException
    • setViewerPreferences

      public void setViewerPreferences(int arg0)
      Specified by:
      setViewerPreferences in interface com.itextpdf.text.pdf.interfaces.PdfViewerPreferences
      Overrides:
      setViewerPreferences in class com.itextpdf.text.pdf.PdfWriter
    • addViewerPreference

      public void addViewerPreference(com.itextpdf.text.pdf.PdfName arg0, com.itextpdf.text.pdf.PdfObject arg1)
      Specified by:
      addViewerPreference in interface com.itextpdf.text.pdf.interfaces.PdfViewerPreferences
      Overrides:
      addViewerPreference in class com.itextpdf.text.pdf.PdfWriter
    • setSigFlags

      public void setSigFlags(int arg0)
      Specified by:
      setSigFlags in interface com.itextpdf.text.pdf.interfaces.PdfAnnotations
      Overrides:
      setSigFlags in class com.itextpdf.text.pdf.PdfWriter
    • setPageAction

      public void setPageAction(com.itextpdf.text.pdf.PdfName arg0, com.itextpdf.text.pdf.PdfAction arg1) throws com.itextpdf.text.pdf.PdfException
      Specified by:
      setPageAction in interface com.itextpdf.text.pdf.interfaces.PdfPageActions
      Overrides:
      setPageAction in class com.itextpdf.text.pdf.PdfWriter
      Throws:
      com.itextpdf.text.pdf.PdfException
    • setDuration

      public void setDuration(int arg0)
      Specified by:
      setDuration in interface com.itextpdf.text.pdf.interfaces.PdfPageActions
      Overrides:
      setDuration in class com.itextpdf.text.pdf.PdfWriter
    • setTransition

      public void setTransition(com.itextpdf.text.pdf.PdfTransition arg0)
      Specified by:
      setTransition in interface com.itextpdf.text.pdf.interfaces.PdfPageActions
      Overrides:
      setTransition in class com.itextpdf.text.pdf.PdfWriter
    • markUsed

      protected void markUsed(com.itextpdf.text.pdf.PdfObject arg0)
    • markUsed

      protected void markUsed(int arg0)
    • getPdfReader

      public com.itextpdf.text.pdf.PdfReader getPdfReader()
    • setAdditionalAction

      public void setAdditionalAction(com.itextpdf.text.pdf.PdfName arg0, com.itextpdf.text.pdf.PdfAction arg1) throws com.itextpdf.text.pdf.PdfException
      Specified by:
      setAdditionalAction in interface com.itextpdf.text.pdf.interfaces.PdfDocumentActions
      Overrides:
      setAdditionalAction in class com.itextpdf.text.pdf.PdfWriter
      Throws:
      com.itextpdf.text.pdf.PdfException
    • setOpenAction

      public void setOpenAction(com.itextpdf.text.pdf.PdfAction arg0)
      Specified by:
      setOpenAction in interface com.itextpdf.text.pdf.interfaces.PdfDocumentActions
      Overrides:
      setOpenAction in class com.itextpdf.text.pdf.PdfWriter
    • setOpenAction

      public void setOpenAction(String arg0)
      Specified by:
      setOpenAction in interface com.itextpdf.text.pdf.interfaces.PdfDocumentActions
      Overrides:
      setOpenAction in class com.itextpdf.text.pdf.PdfWriter
    • setThumbnail

      public void setThumbnail(com.itextpdf.text.Image arg0)
      Overrides:
      setThumbnail in class com.itextpdf.text.pdf.PdfWriter
    • getDirectContentUnder

      public com.itextpdf.text.pdf.PdfContentByte getDirectContentUnder()
      Overrides:
      getDirectContentUnder in class com.itextpdf.text.pdf.PdfWriter
    • getDirectContent

      public com.itextpdf.text.pdf.PdfContentByte getDirectContent()
      Overrides:
      getDirectContent in class com.itextpdf.text.pdf.PdfWriter
    • readOCProperties

      protected void readOCProperties()
    • getPdfLayers

      public Map<String,com.itextpdf.text.pdf.PdfLayer> getPdfLayers()
    • createXmpMetadata

      public void createXmpMetadata()
      Overrides:
      createXmpMetadata in class com.itextpdf.text.pdf.PdfWriter
    • getNamedDestinations

      protected HashMap<Object,com.itextpdf.text.pdf.PdfObject> getNamedDestinations()
    • updateNamedDestinations

      protected void updateNamedDestinations() throws IOException
      Throws:
      IOException