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 PdfDocument
catalog, closed, closeReader, closeWriter, defaultFontStrategy, documentInfoHelper, fingerPrint, flushUnusedObjects, isClosing, pdfConformance, pdfPageFactory, pdfVersion, properties, reader, serializeOptions, structParentIndex, structTreeRoot, tagStructureContext, trailer, writer -
Constructor Summary
ConstructorsConstructorDescriptionPdfADocument(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 TypeMethodDescriptionprivate static PdfWriterconfigureWriterProperties(PdfWriter writer, PdfAConformance aConformance) static PdfACheckergetCorrectCheckerFromConformance(PdfAConformance aConformance) Gets correctPdfACheckerfor specified PDF/A conformance.private static PdfVersiongetPdfVersionAccordingToConformance(PdfAConformance aConformance) Methods inherited from class 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- thePdfWriterobject to write toaConformance- 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- thePdfWriterobject to write toaConformance- the generation and strictness level of the PDF/A that must be followed.outputIntent- aPdfOutputIntentproperties- aDocumentProperties
-
PdfADocument
-
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 correctPdfACheckerfor specified PDF/A conformance.- Parameters:
aConformance- the conformance for which checker is needed- Returns:
- the correct PDF/A checker
-
getPdfVersionAccordingToConformance
-
configureWriterProperties
-