Package com.itextpdf.pdfa
Class PdfADocument
java.lang.Object
com.itextpdf.kernel.pdf.PdfDocument
com.itextpdf.pdfa.PdfADocument
- All Implemented Interfaces:
-
Closeable
,AutoCloseable
This class extends
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 PdfConformance
) 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 PdfConformance
.
-
Field Summary
Fields inherited from class com.itextpdf.kernel.pdf.PdfDocument
catalog, closed, closeReader, closeWriter, defaultFontStrategy, documentInfoHelper, fingerPrint, flushUnusedObjects, isClosing, pdfConformance, pdfPageFactory, pdfVersion, properties, reader, serializeOptions, structParentIndex, structTreeRoot, tagStructureContext, trailer, writer
-
Constructor Summary
ConstructorDescriptionPdfADocument
(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, PdfAConformance aConformance, PdfOutputIntent outputIntent) Constructs a new PdfADocument for writing purposes, i.e.PdfADocument
(PdfWriter writer, PdfAConformance aConformance, PdfOutputIntent outputIntent, DocumentProperties properties) Constructs a new PdfADocument for writing purposes, i.e. -
Method Summary
Modifier and TypeMethodDescriptionstatic PdfAChecker
getCorrectCheckerFromConformance
(PdfAConformance aConformance) Gets correctPdfAChecker
for specified PDF/A conformance.Methods inherited from class com.itextpdf.kernel.pdf.PdfDocument
addAssociatedFile, addEventHandler, addFileAttachment, addFont, addNamedDestination, addNamedDestination, addNewPage, addNewPage, addNewPage, addNewPage, addOutputIntent, addPage, addPage, checkAndAddPage, checkAndAddPage, checkClosingStatus, checkIsoConformance, close, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, createNextIndirectReference, dispatchEvent, findFont, flushCopiedObjects, flushFonts, flushObject, getAssociatedFiles, getCatalog, getConformance, getDefaultFont, getDefaultPageSize, getDiContainer, getDocumentFonts, getDocumentId, getDocumentIdWrapper, getDocumentInfo, getEncryptedPayloadDocument, getFingerPrint, getFirstPage, getFont, getLastPage, getMemoryLimitsAwareHandler, getModifiedDocumentId, getNextStructParentIndex, getNumberOfPages, getNumberOfPdfObjects, getOriginalDocumentId, getOutlines, getPage, getPage, getPageFactory, getPageLabels, getPageNumber, getPageNumber, getPdfObject, getPdfVersion, getReader, getSerializeOptions, getStructTreeRoot, getTagStructureContext, getTrailer, getWriter, getXmpMetadata, getXmpMetadata, getXmpMetadataBytes, getXmpMetadataBytes, hasEventHandler, hasOutlines, initializeOutlines, initTagStructureContext, isAppendMode, isClosed, isCloseReader, isCloseWriter, isClosing, isFlushUnusedObjects, isTagged, listIndirectReferences, markStreamAsEmbeddedFile, movePage, movePage, open, registerProduct, removeAllHandlers, removeEventHandler, removePage, removePage, setCloseReader, setCloseWriter, setDefaultPageSize, setEncryptedPayload, setFlushUnusedObjects, setSerializeOptions, setTagged, setUserProperties, setXmpMetadata, setXmpMetadata, setXmpMetadata, storeDestinationToReaddress, tryInitTagStructure, updateDefaultXmpMetadata, updateXmpMetadata
-
Constructor Details
-
PdfADocument
Constructs a new PdfADocument for writing purposes, i.e. from scratch. A PDF/A file has a conformance, and must have an explicit output intent.- Parameters:
-
writer
- thePdfWriter
object to write to -
aConformance
- the generation and strictness level of the PDF/A that must be followed. -
outputIntent
- aPdfOutputIntent
-
PdfADocument
public PdfADocument(PdfWriter writer, PdfAConformance aConformance, PdfOutputIntent outputIntent, DocumentProperties properties) Constructs a new PdfADocument for writing purposes, i.e. from scratch. A PDF/A file has a conformance, and must have an explicit output intent.- Parameters:
-
writer
- thePdfWriter
object to write to -
aConformance
- the generation and strictness level of the PDF/A that must be followed. -
outputIntent
- aPdfOutputIntent
-
properties
- aDocumentProperties
-
PdfADocument
Opens a PDF/A document in the stamping mode.- Parameters:
-
reader
- PDF reader. -
writer
- PDF writer.
-
PdfADocument
Opens a PDF/A document in stamping mode.- Parameters:
-
reader
- PDF reader. -
writer
- PDF writer. -
properties
- properties of the stamping process
-
-
Method Details
-
getCorrectCheckerFromConformance
Gets correctPdfAChecker
for specified PDF/A conformance.- Parameters:
-
aConformance
- the conformance for which checker is needed - Returns:
- the correct PDF/A checker
-