public class PdfADocument extends PdfDocument
PdfDocument
and is in charge of creating files that comply with the PDF/A standard. Client code is still responsible for making sure the file is actually PDF/A compliant: multiple steps must be undertaken (depending on the PdfAConformanceLevel
) to ensure that the PDF/A standard is followed. This class will throw exceptions, mostly PdfAConformanceException
, and thus refuse to output a PDF/A file if at any point the document does not adhere to the PDF/A guidelines specified by the PdfAConformanceLevel
.
Modifier and Type | Field and Description |
---|---|
protected PdfAChecker |
checker |
catalog, closed, closeReader, closeWriter, eventDispatcher, fingerPrint, flushUnusedObjects, info, isClosing, pdfVersion, properties, reader, serializeOptions, structParentIndex, structTreeRoot, tagStructureContext, trailer, writer, xmpMetadata
Constructor and Description |
---|
PdfADocument(PdfReader reader, PdfWriter writer)
Opens a PDF/A document in the stamping mode.
|
PdfADocument(PdfReader reader, PdfWriter writer, StampingProperties properties)
Opens a PDF/A document in stamping mode.
|
PdfADocument(PdfWriter writer, PdfAConformanceLevel conformanceLevel, PdfOutputIntent outputIntent)
Constructs a new PdfADocument for writing purposes, i.e.
|
PdfADocument(PdfWriter writer, PdfAConformanceLevel conformanceLevel, PdfOutputIntent outputIntent, DocumentProperties properties)
Constructs a new PdfADocument for writing purposes, i.e.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCustomMetadataExtensions(XMPMeta xmpMeta)
Adds custom XMP metadata extension.
|
protected void |
checkIsoConformance()
Checks whether PDF document conforms a specific standard.
|
void |
checkIsoConformance(Object obj, IsoKey key)
Checks whether PDF document conforms a specific standard.
|
void |
checkIsoConformance(Object obj, IsoKey key, PdfResources resources, PdfStream contentStream)
Checks whether PDF document conforms a specific standard.
|
protected void |
flushFonts()
Flushes all newly added or loaded fonts.
|
protected void |
flushObject(PdfObject pdfObject, boolean canBeInObjStm)
Flush an object.
|
PdfAConformanceLevel |
getConformanceLevel()
Gets the PdfAConformanceLevel set in the constructor or in the metadata of the PdfReader .
|
protected IPdfPageFactory |
getPageFactory()
Returns the factory for creating page instances.
|
protected void |
initTagStructureContext()
Initializes tagStructureContext to track necessary information of document's tag structure.
|
protected void |
setChecker(PdfAConformanceLevel conformanceLevel)
Sets the checker that defines the requirements of the PDF/A standard depending on conformance level.
|
protected void |
updateXmpMetadata()
Updates XMP metadata.
|
addAssociatedFile, addEventHandler, addFileAttachment, addFont, addNamedDestination, addNewPage, addNewPage, addNewPage, addNewPage, addOutputIntent, addPage, addPage, checkAndAddPage, checkAndAddPage, checkClosingStatus, checkShowTextIsoConformance, close, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, createNextIndirectReference, dispatchEvent, dispatchEvent, findFont, flushCopiedObjects, getAssociatedFiles, getCatalog, getDefaultFont, getDefaultPageSize, getDocumentFonts, getDocumentId, getDocumentIdWrapper, getDocumentInfo, getEncryptedPayloadDocument, getFingerPrint, getFirstPage, getFont, getLastPage, getModifiedDocumentId, getNextStructParentIndex, getNumberOfPages, getNumberOfPdfObjects, getOriginalDocumentId, getOutlines, getPage, getPage, getPageLabels, getPageNumber, getPageNumber, getPdfObject, getPdfVersion, getReader, getSerializeOptions, getStructTreeRoot, getTagStructureContext, getTrailer, getWriter, getXmpMetadata, getXmpMetadata, hasEventHandler, hasOutlines, initializeOutlines, isAppendMode, isClosed, isCloseReader, isCloseWriter, isFlushUnusedObjects, isTagged, listIndirectReferences, markObjectAsMustBeFlushed, markStreamAsEmbeddedFile, movePage, movePage, open, registerProduct, removeAllHandlers, removeEventHandler, removePage, removePage, setCloseReader, setCloseWriter, setDefaultPageSize, setEncryptedPayload, setFlushUnusedObjects, setSerializeOptions, setTagged, setUserProperties, setXmpMetadata, setXmpMetadata, setXmpMetadata, storeDestinationToReaddress, storeLinkAnnotation, tryInitTagStructure, updateDefaultXmpMetadata
protected PdfAChecker checker
public PdfADocument(PdfWriter writer, PdfAConformanceLevel conformanceLevel, PdfOutputIntent outputIntent)
writer
- the PdfWriter
object to write to
conformanceLevel
- the generation and strictness level of the PDF/A that must be followed.
outputIntent
- a PdfOutputIntent
public PdfADocument(PdfWriter writer, PdfAConformanceLevel conformanceLevel, PdfOutputIntent outputIntent, DocumentProperties properties)
writer
- the PdfWriter
object to write to
conformanceLevel
- the generation and strictness level of the PDF/A that must be followed.
outputIntent
- a PdfOutputIntent
properties
- a DocumentProperties
public PdfADocument(PdfReader reader, PdfWriter writer)
reader
- PDF reader.
writer
- PDF writer.
public PdfADocument(PdfReader reader, PdfWriter writer, StampingProperties properties)
reader
- PDF reader.
writer
- PDF writer.
properties
- properties of the stamping process
public void checkIsoConformance(Object obj, IsoKey key)
PdfDocument
checkIsoConformance
in class PdfDocument
obj
- An object to conform.
key
- type of object to conform.
public void checkIsoConformance(Object obj, IsoKey key, PdfResources resources, PdfStream contentStream)
PdfDocument
checkIsoConformance
in class PdfDocument
obj
- an object to conform.
key
- type of object to conform.
resources
- PdfResources
associated with an object to check.
contentStream
- current content stream
public PdfAConformanceLevel getConformanceLevel()
PdfReader
.
PdfAConformanceLevel
protected void addCustomMetadataExtensions(XMPMeta xmpMeta)
PdfDocument
addCustomMetadataExtensions
in class PdfDocument
xmpMeta
- XMPMeta
to add custom metadata to.
protected void updateXmpMetadata()
PdfDocument
updateXmpMetadata
in class PdfDocument
protected void checkIsoConformance()
PdfDocument
checkIsoConformance
in class PdfDocument
protected void flushObject(PdfObject pdfObject, boolean canBeInObjStm) throws IOException
PdfDocument
flushObject
in class PdfDocument
pdfObject
- object to flush.
canBeInObjStm
- indicates whether object can be placed into object stream.
IOException
- on error.
protected void flushFonts()
PdfDocument
flushFonts
in class PdfDocument
protected void setChecker(PdfAConformanceLevel conformanceLevel)
conformanceLevel
- PdfAConformanceLevel
protected void initTagStructureContext()
initTagStructureContext
in class PdfDocument
protected IPdfPageFactory getPageFactory()
PdfDocument
getPageFactory
in class PdfDocument
IPdfPageFactory
for current document
Copyright © 1998–2022 iText Group NV. All rights reserved.