Package com.itextpdf.pdfa
Class PdfADocument
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfDocument
-
- com.itextpdf.pdfa.PdfADocument
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class PdfADocument extends PdfDocument
This class extendsPdfDocument
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 thePdfConformance
.
-
-
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
Constructors Constructor 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, 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static PdfWriter
configureWriterProperties(PdfWriter writer, PdfAConformance aConformance)
static PdfAChecker
getCorrectCheckerFromConformance(PdfAConformance aConformance)
Gets correctPdfAChecker
for specified PDF/A conformance.private static PdfVersion
getPdfVersionAccordingToConformance(PdfAConformance aConformance)
-
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 Detail
-
PdfADocument
public PdfADocument(PdfWriter writer, PdfAConformance aConformance, PdfOutputIntent outputIntent)
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 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
- thePdfWriter
object to write toaConformance
- the generation and strictness level of the PDF/A that must be followed.outputIntent
- aPdfOutputIntent
properties
- aDocumentProperties
-
PdfADocument
public PdfADocument(PdfReader reader, PdfWriter writer)
Opens a PDF/A document in the stamping mode.- Parameters:
reader
- PDF reader.writer
- PDF writer.
-
PdfADocument
public PdfADocument(PdfReader reader, PdfWriter writer, StampingProperties properties)
Opens a PDF/A document in stamping mode.- Parameters:
reader
- PDF reader.writer
- PDF writer.properties
- properties of the stamping process
-
-
Method Detail
-
getCorrectCheckerFromConformance
public static PdfAChecker getCorrectCheckerFromConformance(PdfAConformance aConformance)
Gets correctPdfAChecker
for specified PDF/A conformance.- Parameters:
aConformance
- the conformance for which checker is needed- Returns:
- the correct PDF/A checker
-
getPdfVersionAccordingToConformance
private static PdfVersion getPdfVersionAccordingToConformance(PdfAConformance aConformance)
-
configureWriterProperties
private static PdfWriter configureWriterProperties(PdfWriter writer, PdfAConformance aConformance)
-
-