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, currentPage, defaultPageSize, documentFonts, eventDispatcher, flushUnusedObjects, info, isClosing, pdfVersion, properties, reader, structParentIndex, structTreeRoot, tagStructureContext, trailer, userProperties, 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)
Open a PDF/A document in stamping mode.
|
PdfADocument(PdfWriter writer, PdfAConformanceLevel conformanceLevel, PdfOutputIntent outputIntent)
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)
Checks whether PDF document conforms a specific standard.
|
void |
checkShowTextIsoConformance(Object obj, PdfResources resources)
Checks whether PDF document conforms a specific standard.
|
protected void |
flushFonts() |
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 Counter |
getCounter()
Gets Counter instance.
|
protected void |
initTagStructureContext()
Initialize TagStructureContext .
|
protected void |
setChecker(PdfAConformanceLevel conformanceLevel) |
protected void |
updateXmpMetadata()
Updates XMP metadata.
|
addEventHandler, addFileAttachment, addFileAttachment, addFileAttachment, addNamedDestination, addNewPage, addNewPage, addNewPage, addNewPage, addOutputIntent, addPage, addPage, checkAndAddPage, checkAndAddPage, checkClosingStatus, close, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, createNextIndirectReference, dispatchEvent, dispatchEvent, getCatalog, getDefaultPageSize, getDocumentFonts, getDocumentInfo, getFirstPage, getLastPage, getNextStructParentIndex, getNumberOfPages, getNumberOfPdfObjects, getOutlines, getPage, getPage, getPageLabels, getPageNumber, getPageNumber, getPdfObject, getPdfVersion, getReader, getStructTreeRoot, getTagStructureContext, getTrailer, getWriter, getXmpMetadata, getXmpMetadata, hasEventHandler, hasOutlines, initializeOutlines, isAppendMode, isClosed, isCloseReader, isCloseWriter, isFlushUnusedObjects, isTagged, listIndirectReferences, markObjectAsMustBeFlushed, open, removeAllHandlers, removeEventHandler, removePage, removePage, setCloseReader, setCloseWriter, setDefaultPageSize, setFlushUnusedObjects, setTagged, setUserProperties, setXmpMetadata, setXmpMetadata, setXmpMetadata, storeLinkAnnotation, 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(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 checkShowTextIsoConformance(Object obj, PdfResources resources)
PdfDocument
checkShowTextIsoConformance
in class PdfDocument
obj
- a CanvasGraphicsState
object to conform.
resources
- PdfResources
associated with an object to check.
public void checkIsoConformance(Object obj, IsoKey key, PdfResources resources)
PdfDocument
checkIsoConformance
in class PdfDocument
obj
- an object to conform.
key
- type of object to conform.
resources
- PdfResources
associated with an object to check.
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()
flushFonts
in class PdfDocument
protected void setChecker(PdfAConformanceLevel conformanceLevel)
protected void initTagStructureContext()
PdfDocument
TagStructureContext
.
initTagStructureContext
in class PdfDocument
protected Counter getCounter()
PdfDocument
Counter
instance.
getCounter
in class PdfDocument
Counter
instance.
Copyright © 1998–2016 iText Group NV. All rights reserved.