Package com.itextpdf.text.pdf
Class PdfAStamperImp
java.lang.Object
com.itextpdf.text.DocWriter
com.itextpdf.text.pdf.PdfWriter
com.itextpdf.text.pdf.PdfStamperImp
com.itextpdf.text.pdf.PdfAStamperImp
- All Implemented Interfaces:
DocListener
,ElementListener
,PdfAnnotations
,PdfDocumentActions
,PdfEncryptionSettings
,PdfPageActions
,PdfRunDirection
,PdfVersion
,PdfViewerPreferences
,EventListener
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.PdfStamperImp
PdfStamperImp.PageStamp
Nested classes/interfaces inherited from class com.itextpdf.text.pdf.PdfWriter
PdfWriter.PdfBody, PdfWriter.PdfTrailer
-
Field Summary
FieldsFields inherited from class com.itextpdf.text.pdf.PdfStamperImp
acroFields, append, closed, fieldsAdded, fieldTemplates, file, flat, flatannotations, flatFreeText, initialXrefSize, marked, myXref, namedDestinations, namePtr, openAction, pagesToContent, partialFlattening, reader, readers2file, readers2intrefs, sigFlags, useVp, 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, 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, ENCRYPTION_MASK, 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
-
Constructor Summary
ConstructorsConstructorDescriptionPdfAStamperImp
(PdfReader reader, OutputStream os, char pdfVersion, boolean append, PdfAConformanceLevel conformanceLevel) Creates new PdfStamperImp. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cacheObject
(PdfIndirectObject iobj) Use this method for caching objects.protected void
createAnnotation
(float llx, float lly, float urx, float ury, PdfAction action, PdfName subtype) A wrapper around PdfAnnotation constructor.createAnnotation
(float llx, float lly, float urx, float ury, PdfString title, PdfString content, PdfName subtype) A wrapper around PdfAnnotation constructor.createAnnotation
(Rectangle rect, PdfName subtype) A wrapper around PdfAnnotation constructor.protected XmpWriter
createXmpWriter
(ByteArrayOutputStream baos, PdfDictionary info) protected XmpWriter
createXmpWriter
(ByteArrayOutputStream baos, HashMap<String, String> info) protected Counter
private PdfAChecker
protected TtfUnicodeWriter
protected PdfIsoConformance
protected void
private void
void
setOutputIntents
(String outputConditionIdentifier, String outputCondition, String registryName, String info, ICC_Profile colorProfile) Sets the values of the output intent dictionary.void
setPDFXConformance
(int pdfx) Always throws an exception since PDF/X conformance level cannot be set for PDF/A conformant documents.Methods inherited from class com.itextpdf.text.pdf.PdfStamperImp
addAnnotation, addAnnotation, addAnnotation, addComments, addDocumentField, addFieldResources, addFileAttachments, addViewerPreference, alterContents, alterResources, applyRotation, close, correctAcroFieldPages, createXmpMetadata, deleteOutlines, eliminateAcroformObjects, expandFields, findAllObjects, flatFields, flatFreeTextFields, flattenAnnotations, getAcroFields, getDirectContent, getDirectContentUnder, getNamedDestinations, getNewObjectNumber, getOverContent, getPageReference, getPageStamp, getPdfLayers, getPdfReader, getReaderFile, getUnderContent, insertPage, isAppend, isContentWritten, isRotateContents, makePackage, markUsed, markUsed, partialFormFlattening, readOCProperties, registerLayer, registerReader, replacePage, setAdditionalAction, setDuration, setDuration, setFlatAnnotations, setFormFlattening, setFreeTextFlattening, setJavaScript, setOpenAction, setOpenAction, setOutlines, setPageAction, setPageAction, setRotateContents, setSigFlags, setThumbnail, setThumbnail, setTransition, setTransition, setViewerPreferences, setViewerPreferences, sweepKids, unRegisterReader, updateNamedDestinations
Methods inherited from class com.itextpdf.text.pdf.PdfWriter
add, add, add, addCalculationOrder, addDeveloperExtension, addDirectImageSimple, addDirectImageSimple, addDirectTemplateSimple, addFileAttachment, addFileAttachment, addFileAttachment, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addLocalDestinations, addNamedDestination, addNamedDestinations, addOCGRadioGroup, addPageDictEntry, addSharedObjectsToBody, addSimple, addSimple, addSimpleExtGState, addSimplePattern, addSimplePatternColorspace, addSimpleProperty, addSimpleShading, addSimpleShadingPattern, addToBody, addToBody, addToBody, addToBody, addToBody, addToBody, addXFormsToBody, buildStructTreeRootForTagged, checkElementRole, checkPdfIsoConformance, checkPdfIsoConformance, clearTextWrap, close, eliminateFontSubset, fillOCProperties, flushAcroFields, flushTaggedObjects, freeReader, getAcroForm, getBoxSize, getBoxSize, getCatalog, getColorProfile, getColorspaceName, getCompressionLevel, getCurrentDocumentSize, getCurrentPage, getCurrentPageNumber, getDefaultColorspace, getEncryption, getExtraCatalog, getGroup, getImageReference, getImportedPage, getIndirectReferenceNumber, getInfo, getInstance, getInstance, getNameString, getOCProperties, getOs, getPageDictEntries, getPageEvent, getPageNumber, getPageSize, getPdfDocument, getPdfIndirectReference, getPdfReaderInstance, getPdfVersion, getPDFXConformance, getReferenceJBIG2Globals, getRootOutline, getRunDirection, getSpaceCharRatio, getStandardStructElems, getStructureTreeRoot, getTabs, getVerticalPosition, getXmpWriter, isFullCompression, isPageEmpty, isPdfIso, isPdfX, isRgbTransparencyBlending, isStrictImageSequence, isTagged, isUserProperties, lockLayer, needToBeMarkedInContent, open, propertyExists, releaseTemplate, reorderPages, resetContent, 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
-
Field Details
-
COUNTER
-
xmpMeta
XMPMeta xmpMeta
-
-
Constructor Details
-
PdfAStamperImp
PdfAStamperImp(PdfReader reader, OutputStream os, char pdfVersion, boolean append, PdfAConformanceLevel conformanceLevel) throws DocumentException, IOException Creates new PdfStamperImp.- Parameters:
reader
- reads the PDFos
- the output destinationpdfVersion
- the new pdf version or '\0' to keep the same version as the original documentappend
-conformanceLevel
- PDF/A conformance level of a new PDF document- Throws:
DocumentException
- on errorIOException
-
-
Method Details
-
readColorProfile
protected void readColorProfile()- Overrides:
readColorProfile
in classPdfStamperImp
-
setOutputIntents
public void setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, ICC_Profile colorProfile) throws IOException Description copied from class:PdfWriter
Sets the values of the output intent dictionary. Null values are allowed to suppress any key.- Overrides:
setOutputIntents
in classPdfWriter
- Parameters:
outputConditionIdentifier
- a valueoutputCondition
- a valueregistryName
- a valueinfo
- a valuecolorProfile
- a value- Throws:
IOException
- on error- See Also:
-
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 classPdfWriter
- Parameters:
pdfx
-- See Also:
-
getTtfUnicodeWriter
- Overrides:
getTtfUnicodeWriter
in classPdfWriter
- See Also:
-
createXmpWriter
protected XmpWriter createXmpWriter(ByteArrayOutputStream baos, PdfDictionary info) throws IOException - Overrides:
createXmpWriter
in classPdfWriter
- Throws:
IOException
- See Also:
-
createXmpWriter
protected XmpWriter createXmpWriter(ByteArrayOutputStream baos, HashMap<String, String> info) throws IOException- Overrides:
createXmpWriter
in classPdfWriter
- Throws:
IOException
-
initPdfIsoConformance
- Overrides:
initPdfIsoConformance
in classPdfWriter
- See Also:
-
getCounter
- Overrides:
getCounter
in classPdfStamperImp
-
readPdfAInfo
private void readPdfAInfo() -
cacheObject
Description copied from class:PdfWriter
Use this method for caching objects.- Overrides:
cacheObject
in classPdfWriter
- Parameters:
iobj
- @see PdfIndirectObject
-
getPdfAChecker
-
close
- Overrides:
close
in classPdfStamperImp
- Throws:
IOException
-
createAnnotation
Description copied from class:PdfWriter
A wrapper around PdfAnnotation constructor. It is recommended to use this wrapper instead of direct constructor as this is a convenient way to override PdfAnnotation construction when needed.- Overrides:
createAnnotation
in classPdfWriter
- Parameters:
rect
-subtype
-- Returns:
-
createAnnotation
public PdfAnnotation createAnnotation(float llx, float lly, float urx, float ury, PdfString title, PdfString content, PdfName subtype) Description copied from class:PdfWriter
A wrapper around PdfAnnotation constructor. It is recommended to use this wrapper instead of direct constructor as this is a convenient way to override PdfAnnotation construction when needed.- Overrides:
createAnnotation
in classPdfWriter
- Parameters:
llx
-lly
-urx
-ury
-title
-content
-subtype
-- Returns:
-
createAnnotation
public PdfAnnotation createAnnotation(float llx, float lly, float urx, float ury, PdfAction action, PdfName subtype) Description copied from class:PdfWriter
A wrapper around PdfAnnotation constructor. It is recommended to use this wrapper instead of direct constructor as this is a convenient way to override PdfAnnotation construction when needed.- Overrides:
createAnnotation
in classPdfWriter
- Parameters:
llx
-lly
-urx
-ury
-action
-subtype
-- Returns:
-
getXmpMeta
-