com.itextpdf.text.pdf
Class PdfAStamperImp

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

public class PdfAStamperImp
extends 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
PdfWriter.PdfBody, PdfWriter.PdfTrailer
 
Field Summary
protected  AcroFields acroFields
           
protected  boolean append
           
protected  boolean closed
           
protected  Counter COUNTER
           
protected  boolean fieldsAdded
           
protected  HashSet<PdfTemplate> fieldTemplates
           
protected  RandomAccessFileOrArray file
           
protected  boolean flat
           
protected  boolean flatFreeText
           
protected  int initialXrefSize
           
protected  IntHashtable marked
           
protected  int[] namePtr
           
protected  PdfAction openAction
           
protected  HashSet<String> partialFlattening
           
protected  int sigFlags
           
protected  boolean useVp
           
protected  PdfViewerPreferencesImp viewerPreferences
           
 
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, 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, newBookmarks, NO_SPACE_CHAR_RATIO, NonFullScreenPageModeUseNone, NonFullScreenPageModeUseOC, NonFullScreenPageModeUseOutlines, NonFullScreenPageModeUseThumbs, OCGLocked, OCGRadioGroup, OCProperties, 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, ttfUnicodeWriter, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, VERSION_1_6, VERSION_1_7, WILL_PRINT, WILL_SAVE, xmpMetadata
 
Fields inherited from class com.itextpdf.text.DocWriter
closeStream, document, EQUALS, FORWARD, GT, LT, NEWLINE, open, os, pageSize, pause, QUOTE, SPACE, TAB
 
Method Summary
 void addAnnotation(PdfAnnotation arg0)
           
 void addComments(FdfReader arg0)
           
protected  void addFieldResources()
           
protected  void addFileAttachments()
           
 void addViewerPreference(PdfName arg0, PdfObject arg1)
           
protected  void alterContents()
           
protected  void close(Map<String,String> arg0)
           
protected  void close(PdfIndirectReference arg0, int arg1)
           
protected  void flatFields()
           
protected  void flatFreeTextFields()
           
protected  Counter getCounter()
           
 PdfContentByte getDirectContent()
           
 PdfContentByte getDirectContentUnder()
           
protected  int getNewObjectNumber(PdfReader arg0, int arg1, int arg2)
           
 PdfIndirectReference getPageReference(int arg0)
           
protected  PdfIsoConformance getPdfIsoConformance()
           
 Map<String,PdfLayer> getPdfLayers()
           
protected  TtfUnicodeWriter getTtfUnicodeWriter()
           
protected  XmpWriter getXmpWriter(ByteArrayOutputStream baos, PdfDictionary info)
           
 boolean isPdfIso()
           
protected  void markUsed(int arg0)
           
protected  void markUsed(PdfObject arg0)
           
protected  void readOCProperties()
           
 void registerReader(PdfReader arg0, boolean arg1)
           
 void setAdditionalAction(PdfName arg0, PdfAction arg1)
           
 void setDuration(int arg0)
           
protected  void setJavaScript()
           
 void setOpenAction(PdfAction arg0)
           
 void setOpenAction(String arg0)
           
protected  void setOutlines()
           
 void setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, ICC_Profile colorProfile)
           
 void setPageAction(PdfName arg0, PdfAction arg1)
           
 void setPDFXConformance(int pdfx)
          Always throws an exception since PDF/X conformance level cannot be set for PDF/A conformant documents.
 void setSigFlags(int arg0)
           
 void setThumbnail(Image arg0)
           
 void setTransition(PdfTransition arg0)
           
protected  void setViewerPreferences()
           
 void setViewerPreferences(int arg0)
           
 void unRegisterReader(PdfReader arg0)
           
 
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, checkPdfIsoConformance, checkPdfIsoConformance, clearTextWrap, close, createXmpMetadata, fillOCProperties, flushTaggedObjects, freeReader, getAcroForm, getBoxSize, getCatalog, getCompressionLevel, getCurrentDocumentSize, getCurrentPageNumber, getDefaultColorspace, getExtraCatalog, getGroup, getImportedPage, getIndirectReferenceNumber, getInfo, getInstance, getInstance, getOCProperties, getOs, getPageDictEntries, getPageEvent, getPageNumber, getPageSize, getPdfIndirectReference, getPdfReaderInstance, getPDFXConformance, getReferenceJBIG2Globals, getRootOutline, getRunDirection, getSpaceCharRatio, getStandardStructElems, getStructureTreeRoot, getTabs, getVerticalPosition, isFullCompression, isPageEmpty, isPdfX, isRgbTransparencyBlending, isStrictImageSequence, isTagged, isUserProperties, lockLayer, 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, setUserProperties, setUserunit, setXmpMetadata, 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 Detail

COUNTER

protected Counter COUNTER

file

protected RandomAccessFileOrArray file

closed

protected boolean closed

acroFields

protected AcroFields acroFields

flat

protected boolean flat

flatFreeText

protected boolean flatFreeText

namePtr

protected int[] namePtr

partialFlattening

protected HashSet<String> partialFlattening

useVp

protected boolean useVp

viewerPreferences

protected PdfViewerPreferencesImp viewerPreferences

fieldTemplates

protected HashSet<PdfTemplate> fieldTemplates

fieldsAdded

protected boolean fieldsAdded

sigFlags

protected int sigFlags

append

protected boolean append

marked

protected IntHashtable marked

initialXrefSize

protected int initialXrefSize

openAction

protected PdfAction openAction
Method Detail

setOutputIntents

public void setOutputIntents(String outputConditionIdentifier,
                             String outputCondition,
                             String registryName,
                             String info,
                             ICC_Profile colorProfile)
                      throws IOException
Overrides:
setOutputIntents in class PdfWriter
Throws:
IOException
See Also:
PdfStamperImp#setOutputIntents(String, String, String, String, ICC_Profile)

isPdfIso

public boolean isPdfIso()
Overrides:
isPdfIso in class PdfWriter
See Also:
PdfWriter.isPdfIso()

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 PdfWriter
Parameters:
pdfx -

getTtfUnicodeWriter

protected TtfUnicodeWriter getTtfUnicodeWriter()
Overrides:
getTtfUnicodeWriter in class PdfWriter
See Also:
PdfWriter.getTtfUnicodeWriter()

getXmpWriter

protected XmpWriter getXmpWriter(ByteArrayOutputStream baos,
                                 PdfDictionary info)
                          throws IOException
Overrides:
getXmpWriter in class PdfWriter
Throws:
IOException
See Also:
PdfStamperImp#getXmpWriter(java.io.ByteArrayOutputStream, com.itextpdf.text.pdf.PdfDictionary)

getPdfIsoConformance

protected PdfIsoConformance getPdfIsoConformance()
Overrides:
getPdfIsoConformance in class PdfWriter
See Also:
PdfWriter.getPdfIsoConformance()

getCounter

protected Counter getCounter()

setViewerPreferences

protected void setViewerPreferences()

close

protected void close(Map<String,String> arg0)
              throws IOException
Throws:
IOException

close

protected void close(PdfIndirectReference arg0,
                     int arg1)
              throws IOException
Throws:
IOException

alterContents

protected void alterContents()
                      throws IOException
Throws:
IOException

getNewObjectNumber

protected int getNewObjectNumber(PdfReader arg0,
                                 int arg1,
                                 int arg2)
Overrides:
getNewObjectNumber in class PdfWriter

registerReader

public void registerReader(PdfReader arg0,
                           boolean arg1)
                    throws IOException
Throws:
IOException

unRegisterReader

public void unRegisterReader(PdfReader arg0)

addComments

public void addComments(FdfReader arg0)
                 throws IOException
Throws:
IOException

flatFields

protected void flatFields()

flatFreeTextFields

protected void flatFreeTextFields()

getPageReference

public PdfIndirectReference getPageReference(int arg0)
Overrides:
getPageReference in class PdfWriter

addAnnotation

public void addAnnotation(PdfAnnotation arg0)
Specified by:
addAnnotation in interface PdfAnnotations
Overrides:
addAnnotation in class 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 PdfViewerPreferences
Overrides:
setViewerPreferences in class PdfWriter

addViewerPreference

public void addViewerPreference(PdfName arg0,
                                PdfObject arg1)
Specified by:
addViewerPreference in interface PdfViewerPreferences
Overrides:
addViewerPreference in class PdfWriter

setSigFlags

public void setSigFlags(int arg0)
Specified by:
setSigFlags in interface PdfAnnotations
Overrides:
setSigFlags in class PdfWriter

setPageAction

public void setPageAction(PdfName arg0,
                          PdfAction arg1)
                   throws PdfException
Specified by:
setPageAction in interface PdfPageActions
Overrides:
setPageAction in class PdfWriter
Throws:
PdfException

setDuration

public void setDuration(int arg0)
Specified by:
setDuration in interface PdfPageActions
Overrides:
setDuration in class PdfWriter

setTransition

public void setTransition(PdfTransition arg0)
Specified by:
setTransition in interface PdfPageActions
Overrides:
setTransition in class PdfWriter

markUsed

protected void markUsed(PdfObject arg0)

markUsed

protected void markUsed(int arg0)

setAdditionalAction

public void setAdditionalAction(PdfName arg0,
                                PdfAction arg1)
                         throws PdfException
Specified by:
setAdditionalAction in interface PdfDocumentActions
Overrides:
setAdditionalAction in class PdfWriter
Throws:
PdfException

setOpenAction

public void setOpenAction(PdfAction arg0)
Specified by:
setOpenAction in interface PdfDocumentActions
Overrides:
setOpenAction in class PdfWriter

setOpenAction

public void setOpenAction(String arg0)
Specified by:
setOpenAction in interface PdfDocumentActions
Overrides:
setOpenAction in class PdfWriter

setThumbnail

public void setThumbnail(Image arg0)
Overrides:
setThumbnail in class PdfWriter

getDirectContentUnder

public PdfContentByte getDirectContentUnder()
Overrides:
getDirectContentUnder in class PdfWriter

getDirectContent

public PdfContentByte getDirectContent()
Overrides:
getDirectContent in class PdfWriter

readOCProperties

protected void readOCProperties()

getPdfLayers

public Map<String,PdfLayer> getPdfLayers()


Copyright © 2013. All Rights Reserved.