com.itextpdf.text.pdf
Class PdfAWriter

java.lang.Object
  extended by com.itextpdf.text.DocWriter
      extended by com.itextpdf.text.pdf.PdfWriter
          extended by com.itextpdf.text.pdf.PdfAWriter
All Implemented Interfaces:
DocListener, ElementListener, PdfAnnotations, PdfDocumentActions, PdfEncryptionSettings, PdfIsoConformance, PdfPageActions, PdfRunDirection, PdfVersion, PdfViewerPreferences, EventListener

public class PdfAWriter
extends PdfWriter

Extension of PdfWriter that will attempt to create a PDF/A file instead of an ordinary PDF file.

See Also:
PdfWriter

Nested Class Summary
 
Nested classes/interfaces inherited from class com.itextpdf.text.pdf.PdfWriter
PdfWriter.PdfBody, PdfWriter.PdfTrailer
 
Field Summary
 
Fields inherited from class com.itextpdf.text.pdf.PdfWriter
ALLOW_ASSEMBLY, ALLOW_COPY, ALLOW_DEGRADED_PRINTING, ALLOW_FILL_IN, ALLOW_MODIFY_ANNOTATIONS, ALLOW_MODIFY_CONTENTS, ALLOW_PRINTING, ALLOW_SCREENREADERS, AllowAssembly, AllowCopy, AllowDegradedPrinting, AllowFillIn, AllowModifyAnnotations, AllowModifyContents, AllowPrinting, AllowScreenReaders, body, CenterWindow, colorNumber, compressionLevel, crypto, currentPageNumber, currentPdfReaderInstance, defaultColorspace, DID_PRINT, DID_SAVE, directContent, directContentUnder, DirectionL2R, DirectionR2L, DisplayDocTitle, DO_NOT_ENCRYPT_METADATA, DOCUMENT_CLOSE, documentColors, documentExtGState, documentFonts, documentOCG, documentOCGorder, documentPatterns, documentProperties, documentShadingPatterns, documentShadings, documentSpotPatterns, EMBEDDED_FILES_ONLY, ENCRYPTION_AES_128, ENCRYPTION_AES_256, extraCatalog, FitWindow, fontNumber, formXObjects, formXObjectsCounter, fullCompression, GENERATION_MAX, group, HideMenubar, HideToolbar, HideWindowUI, imageDictionary, JBIG2Globals, newBookmarks, NO_SPACE_CHAR_RATIO, NonFullScreenPageModeUseNone, NonFullScreenPageModeUseOC, NonFullScreenPageModeUseOutlines, NonFullScreenPageModeUseThumbs, OCGLocked, OCGRadioGroup, OCProperties, PAGE_CLOSE, PAGE_OPEN, pageDictEntries, PageLayoutOneColumn, PageLayoutSinglePage, PageLayoutTwoColumnLeft, PageLayoutTwoColumnRight, PageLayoutTwoPageLeft, PageLayoutTwoPageRight, PageModeFullScreen, PageModeUseAttachments, PageModeUseNone, PageModeUseOC, PageModeUseOutlines, PageModeUseThumbs, pageReferences, patternColorspaceCMYK, patternColorspaceGRAY, patternColorspaceRGB, patternNumber, pdf, pdf_version, PDF_VERSION_1_2, PDF_VERSION_1_3, PDF_VERSION_1_4, PDF_VERSION_1_5, PDF_VERSION_1_6, PDF_VERSION_1_7, pdfIsoConformance, PDFX1A2001, PDFX32002, PDFXNONE, prevxref, PrintScalingNone, readerInstances, root, RUN_DIRECTION_DEFAULT, RUN_DIRECTION_LTR, RUN_DIRECTION_NO_BIDI, RUN_DIRECTION_RTL, runDirection, SIGNATURE_APPEND_ONLY, SIGNATURE_EXISTS, SPACE_CHAR_RATIO_DEFAULT, STANDARD_ENCRYPTION_128, STANDARD_ENCRYPTION_40, STRENGTH128BITS, STRENGTH40BITS, structureTreeRoot, tabs, tagged, ttfUnicodeWriter, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, VERSION_1_6, VERSION_1_7, WILL_PRINT, WILL_SAVE, xmpMetadata, xmpWriter
 
Fields inherited from class com.itextpdf.text.DocWriter
closeStream, document, EQUALS, FORWARD, GT, LT, NEWLINE, open, os, pageSize, pause, QUOTE, SPACE, TAB
 
Constructor Summary
protected PdfAWriter(PdfAConformanceLevel conformanceLevel)
           
protected PdfAWriter(PdfDocument document, OutputStream os, PdfAConformanceLevel conformanceLevel)
          Constructs a PdfAWriter.
 
Method Summary
protected  void checkPdfIsoConformance(int key, Object obj1)
           
static PdfAWriter getInstance(Document document, OutputStream os, DocListener listener, PdfAConformanceLevel conformanceLevel)
          Use this method to get an instance of the PdfWriter.
static PdfAWriter getInstance(Document document, OutputStream os, PdfAConformanceLevel conformanceLevel)
          Use this method to get an instance of the PdfWriter.
protected  PdfIsoConformance getPdfIsoConformance()
           
protected  TtfUnicodeWriter getTtfUnicodeWriter()
           
protected  XmpWriter getXmpWriter(ByteArrayOutputStream baos, PdfDocument.PdfInfo info)
           
 boolean isPdfIso()
           
 void setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, ICC_Profile colorProfile)
           
static void setPdfVersion(PdfWriter writer, PdfAConformanceLevel conformanceLevel)
          Sets the Confomance level.
 void setPDFXConformance(int pdfx)
          Always throws an exception since PDF/X conformance level cannot be set for PDF/A conformant documents.
 
Methods inherited from class com.itextpdf.text.pdf.PdfWriter
add, addAnnotation, addCalculationOrder, addDeveloperExtension, addDirectImageSimple, addDirectImageSimple, addFileAttachment, addFileAttachment, addFileAttachment, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addJavaScript, addNamedDestination, addNamedDestinations, addOCGRadioGroup, addPageDictEntry, addSharedObjectsToBody, addToBody, addToBody, addToBody, addToBody, addToBody, addToBody, addViewerPreference, addXFormsToBody, checkPdfIsoConformance, clearTextWrap, close, createXmpMetadata, fillOCProperties, freeReader, getAcroForm, getBoxSize, getCatalog, getCompressionLevel, getCurrentDocumentSize, getCurrentPageNumber, getDefaultColorspace, getDirectContent, getDirectContentUnder, getExtraCatalog, getGroup, getImportedPage, getIndirectReferenceNumber, getInfo, getInstance, getInstance, getNewObjectNumber, getOCProperties, getOs, getPageDictEntries, getPageEvent, getPageNumber, getPageReference, getPageSize, getPdfIndirectReference, getPdfReaderInstance, getPDFXConformance, getReferenceJBIG2Globals, getRootOutline, getRunDirection, getSpaceCharRatio, getStructureTreeRoot, getTabs, getVerticalPosition, isFullCompression, isPageEmpty, isPdfX, isRgbTransparencyBlending, isStrictImageSequence, isTagged, isUserProperties, lockLayer, open, releaseTemplate, reorderPages, resetPageDictEntries, setAdditionalAction, setAtLeastPdfVersion, setBoxSize, setCollection, setCompressionLevel, setCropBoxSize, setDefaultColorspace, setDuration, setEncryption, setEncryption, setEncryption, setEncryption, setEncryption, setFullCompression, setGroup, setInitialLeading, setLinearPageMode, setOpenAction, setOpenAction, setOutlines, setOutputIntents, setOutputIntents, setPageAction, setPageEmpty, setPageEvent, setPageLabels, setPageViewport, setPageXmpMetadata, setPdfVersion, setPdfVersion, setRgbTransparencyBlending, setRunDirection, setSigFlags, setSpaceCharRatio, setStrictImageSequence, setTabs, setTagged, setThumbnail, setTransition, setUserProperties, setUserunit, setViewerPreferences, setXmpMetadata, writeKeyInfo, writeOutlines
 
Methods inherited from class com.itextpdf.text.DocWriter
add, addTabs, flush, getISOBytes, isCloseStream, isPaused, newPage, pause, resetPageCount, resume, setCloseStream, setMarginMirroring, setMarginMirroringTopBottom, setMargins, setPageCount, setPageSize, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfAWriter

protected PdfAWriter(PdfAConformanceLevel conformanceLevel)
Parameters:
conformanceLevel - PDF/A conformance level of a new PDF document

PdfAWriter

protected PdfAWriter(PdfDocument document,
                     OutputStream os,
                     PdfAConformanceLevel conformanceLevel)
Constructs a PdfAWriter.

Remark: a PdfAWriter can only be constructed by calling the method getInstance(Document document, OutputStream os, PdfAconformanceLevel conformanceLevel).

Parameters:
document - the PdfDocument that has to be written
os - the OutputStream the writer has to write to
conformanceLevel - PDF/A conformance level of a new PDF document
Method Detail

getInstance

public static PdfAWriter getInstance(Document document,
                                     OutputStream os,
                                     PdfAConformanceLevel conformanceLevel)
                              throws DocumentException
Use this method to get an instance of the PdfWriter.

Parameters:
document - The Document that has to be written
os - The OutputStream the writer has to write to.
conformanceLevel - PDF/A conformance level of a new PDF document
Returns:
a new PdfWriter
Throws:
DocumentException - on error

getInstance

public static PdfAWriter getInstance(Document document,
                                     OutputStream os,
                                     DocListener listener,
                                     PdfAConformanceLevel conformanceLevel)
                              throws DocumentException
Use this method to get an instance of the PdfWriter.

Parameters:
document - The Document that has to be written
os - The OutputStream the writer has to write to.
listener - A DocListener to pass to the PdfDocument.
conformanceLevel - PDF/A conformance level of a new PDF document
Returns:
a new PdfWriter
Throws:
DocumentException - on error

setPdfVersion

public static void setPdfVersion(PdfWriter writer,
                                 PdfAConformanceLevel conformanceLevel)
Sets the Confomance level.

Parameters:
writer -
conformanceLevel -

setOutputIntents

public void setOutputIntents(String outputConditionIdentifier,
                             String outputCondition,
                             String registryName,
                             String info,
                             ICC_Profile colorProfile)
                      throws IOException
Overrides:
setOutputIntents in class PdfWriter
Throws:
IOException
See Also:
PdfWriter#setOutputIntents(String, String, String, String, ICC_Profile)

setPDFXConformance

public void setPDFXConformance(int pdfx)
Always throws an exception since PDF/X conformance level cannot be set for PDF/A conformant documents.

Overrides:
setPDFXConformance in class PdfWriter
Parameters:
pdfx -

isPdfIso

public boolean isPdfIso()
Specified by:
isPdfIso in interface PdfIsoConformance
Overrides:
isPdfIso in class PdfWriter
See Also:
PdfWriter.isPdfIso()

getTtfUnicodeWriter

protected TtfUnicodeWriter getTtfUnicodeWriter()
Overrides:
getTtfUnicodeWriter in class PdfWriter
See Also:
PdfWriter.getTtfUnicodeWriter()

getXmpWriter

protected XmpWriter getXmpWriter(ByteArrayOutputStream baos,
                                 PdfDocument.PdfInfo info)
                          throws IOException
Overrides:
getXmpWriter in class PdfWriter
Throws:
IOException
See Also:
PdfWriter#getXmpWriter(java.io.ByteArrayOutputStream, com.itextpdf.text.pdf.PdfDocument.PdfInfo)

checkPdfIsoConformance

protected void checkPdfIsoConformance(int key,
                                      Object obj1)
Overrides:
checkPdfIsoConformance in class PdfWriter
See Also:
PdfWriter#checkPdfIsoConformance(int, Object)

getPdfIsoConformance

protected PdfIsoConformance getPdfIsoConformance()
Overrides:
getPdfIsoConformance in class PdfWriter
See Also:
PdfWriter.getPdfIsoConformance()


Copyright © 2012. All Rights Reserved.