Package com.itextpdf.pdfua
Class PdfUADocument
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfDocument
-
- com.itextpdf.pdfua.PdfUADocument
-
- All Implemented Interfaces:
IEventDispatcher
,java.io.Closeable
,java.lang.AutoCloseable
public class PdfUADocument extends PdfDocument
Creates a Pdf/UA document. This class is an extension of PdfDocument and adds the necessary configuration for PDF/UA conformance. It will add necessary validation to guide the user to create a PDF/UA compliant document.
-
-
Field Summary
Fields Modifier and Type Field Description private PdfUAConfig
config
private static org.slf4j.Logger
LOGGER
private static IPdfPageFactory
pdfPageFactory
private boolean
warnedOnPageFlush
-
Fields inherited from class com.itextpdf.kernel.pdf.PdfDocument
catalog, closed, closeReader, closeWriter, eventDispatcher, fingerPrint, flushUnusedObjects, info, isClosing, pdfVersion, properties, reader, serializeOptions, structParentIndex, structTreeRoot, tagStructureContext, trailer, writer, xmpMetadata
-
-
Constructor Summary
Constructors Constructor Description PdfUADocument(PdfReader reader, PdfWriter writer, StampingProperties properties, PdfUAConfig config)
Creates a PdfUADocument instance.PdfUADocument(PdfReader reader, PdfWriter writer, PdfUAConfig config)
Creates a PdfUADocument instance.PdfUADocument(PdfWriter writer, DocumentProperties properties, PdfUAConfig config)
Creates a PdfUADocument instance.PdfUADocument(PdfWriter writer, PdfUAConfig config)
Creates a PdfUADocument instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static PdfWriter
configureWriterProperties(PdfWriter writer)
void
disablePageFlushingWarning()
Disables the warning for page flushing.IConformanceLevel
getConformanceLevel()
{inheritDoc}protected IPdfPageFactory
getPageFactory()
Returns the factory for creating page instances.(package private) boolean
isClosing()
Returns if the document is in the closing state.private void
setupUAConfiguration(PdfUAConfig config)
(package private) void
warnOnPageFlush()
Warns the user that the page is being flushed.-
Methods inherited from class com.itextpdf.kernel.pdf.PdfDocument
addAssociatedFile, addCustomMetadataExtensions, addEventHandler, addFileAttachment, addFont, addNamedDestination, addNamedDestination, addNewPage, addNewPage, addNewPage, addNewPage, addOutputIntent, addPage, addPage, checkAndAddPage, checkAndAddPage, checkClosingStatus, checkIsoConformance, checkIsoConformance, checkIsoConformance, checkIsoConformance, checkShowTextIsoConformance, close, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, copyPagesTo, createNextIndirectReference, dispatchEvent, dispatchEvent, findFont, flushCopiedObjects, flushFonts, flushInfoDictionary, flushObject, getAssociatedFiles, getCatalog, getDefaultFont, getDefaultPageSize, getDiContainer, getDocumentFonts, getDocumentId, getDocumentIdWrapper, getDocumentInfo, getEncryptedPayloadDocument, getFingerPrint, getFirstPage, getFont, getLastPage, getMemoryLimitsAwareHandler, getModifiedDocumentId, getNextStructParentIndex, getNumberOfPages, getNumberOfPdfObjects, getOriginalDocumentId, getOutlines, getPage, getPage, getPageLabels, getPageNumber, getPageNumber, getPdfObject, getPdfVersion, getReader, getSerializeOptions, getStructTreeRoot, getTagStructureContext, getTrailer, getWriter, getXmpMetadata, getXmpMetadata, hasEventHandler, hasOutlines, initializeOutlines, initTagStructureContext, 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, tryInitTagStructure, updateDefaultXmpMetadata, updateXmpMetadata
-
-
-
-
Field Detail
-
pdfPageFactory
private static final IPdfPageFactory pdfPageFactory
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
config
private PdfUAConfig config
-
warnedOnPageFlush
private boolean warnedOnPageFlush
-
-
Constructor Detail
-
PdfUADocument
public PdfUADocument(PdfWriter writer, PdfUAConfig config)
Creates a PdfUADocument instance.- Parameters:
writer
- The writer to write the PDF document.config
- The configuration for the PDF/UA document.
-
PdfUADocument
public PdfUADocument(PdfWriter writer, DocumentProperties properties, PdfUAConfig config)
Creates a PdfUADocument instance.- Parameters:
writer
- The writer to write the PDF document.properties
- The properties for the PDF document.config
- The configuration for the PDF/UA document.
-
PdfUADocument
public PdfUADocument(PdfReader reader, PdfWriter writer, PdfUAConfig config)
Creates a PdfUADocument instance.- Parameters:
reader
- The reader to read the PDF document.writer
- The writer to write the PDF document.config
- The configuration for the PDF/UA document.
-
PdfUADocument
public PdfUADocument(PdfReader reader, PdfWriter writer, StampingProperties properties, PdfUAConfig config)
Creates a PdfUADocument instance.- Parameters:
reader
- The reader to read the PDF document.writer
- The writer to write the PDF document.properties
- The properties for the PDF document.config
- The configuration for the PDF/UA document.
-
-
Method Detail
-
getConformanceLevel
public IConformanceLevel getConformanceLevel()
{inheritDoc}- Overrides:
getConformanceLevel
in classPdfDocument
- Returns:
- the
IConformanceLevel
will be null if the document does not have a conformance level specified
-
getPageFactory
protected IPdfPageFactory getPageFactory()
Description copied from class:PdfDocument
Returns the factory for creating page instances.- Overrides:
getPageFactory
in classPdfDocument
- Returns:
- The PageFactory for the PDF/UA document.
-
isClosing
boolean isClosing()
Returns if the document is in the closing state.- Returns:
- true if the document is closing, false otherwise.
-
warnOnPageFlush
void warnOnPageFlush()
Warns the user that the page is being flushed. Will only warn once.
-
disablePageFlushingWarning
public void disablePageFlushingWarning()
Disables the warning for page flushing.
-
setupUAConfiguration
private void setupUAConfiguration(PdfUAConfig config)
-
-