|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler org.ujac.print.DocumentHandler
public class DocumentHandler
Name: DocumentHandler
Description: XML content handler, managing core tasks of the XML to iText processing framework.
Field Summary | |
---|---|
protected com.lowagie.text.pdf.PdfPageLabels |
pdfLabels
The Pdf Page Labels can be seen on the pages tab in acrobat. |
Constructor Summary | |
---|---|
DocumentHandler(OutputStream outputStream,
TemplateContext templateContext,
DocumentTagFactory tagFactory)
Constructs a DocumentHandler instance with specific arguments. |
|
DocumentHandler(OutputStream outputStream,
TemplateInterpreter templateInterpreter,
TemplateContext templateContext,
DocumentTagFactory tagFactory)
Constructs a DocumentHandler instance with specific arguments. |
Method Summary | |
---|---|
void |
addOutline(OutlineItem outlineItem)
Adds an outline item. |
void |
addTocItem(TocItem tocItem)
Adds a TOC item. |
void |
applyCurrentLogicalPageNumberStyle()
Applies the logical page Numbering style for the generated PDF. |
void |
cacheImage(Object source,
com.lowagie.text.Image img)
Putting image into cache. |
void |
characters(char[] ch,
int start,
int length)
|
void |
clearPageEventHandlers()
Removes all current page event handlers. |
void |
clearReferences()
Clears all references. |
DocumentFont |
createFont(String fontName,
String encoding,
float size,
int style,
float textRise,
Color color)
Creates a font according to the given attributes. |
com.lowagie.text.pdf.PdfPageEvent |
createPageEventHandler()
Creates a new page event handler. |
void |
disableTemplateCopyWriter()
Disables the template copy writer to avoid the copy of internally processed XML stuff. |
void |
enableTemplateCopyWriter()
Enables the template copy writer again. |
void |
endDocument()
|
void |
endElement(String uri,
String localName,
String qName)
|
boolean |
evalBoolean(String expression)
Evaluates a text, which is likely to contain expressions as a boolean. |
Date |
evalDate(String expression)
Evaluates a text, which is likely to contain expressions as a Date. |
double |
evalDouble(String expression)
Evaluates a text, which is likely to contain expressions as a double. |
float |
evalFloat(String expression)
Evaluates a text, which is likely to contain expressions as a float. |
int |
evalInt(String expression)
Evaluates a text, which is likely to contain expressions as an int. |
long |
evalLong(String expression)
Evaluates a text, which is likely to contain expressions as an long. |
Object |
evalObject(String expression)
Evaluates a text, which is likely to contain expressions as am Object. |
String |
evalString(String expression)
Evaluates a text, which is likely to contain expressions as a String. |
Time |
evalTime(String expression)
Evaluates a text, which is likely to contain expressions as a Time. |
Timestamp |
evalTimestamp(String expression)
Evaluates a text, which is likely to contain expressions as a Timestamp. |
String |
executeTemplate(String templateSource)
Executes the given template source. |
protected TocItem |
flushTocChapter(com.lowagie.text.pdf.PdfWriter writer,
float verticalPosition)
Processes the next unnumbered TOC chapter. |
protected void |
flushTocItems(com.lowagie.text.pdf.PdfWriter writer)
Processes all currently unnumbered TOC items. |
protected TocItem |
flushTocSection(com.lowagie.text.pdf.PdfWriter writer,
float verticalPosition)
Processes the next unnumbered TOC section. |
AttributeHandler |
getAttributeHandler()
Getter method for the the property attributeHandler. |
Font |
getAwtFont(DocumentFont font)
Gets the BaseFont for the given font name and style. |
com.lowagie.text.pdf.BaseFont |
getBaseFont(String fontName,
int style)
Gets the BaseFont for the given font name and style. |
com.lowagie.text.Image |
getCachedImage(Object source)
Getting image from cache. |
Color |
getColor(String colorName)
Gets a color from the color registry. |
ContentFilter |
getContentFilter()
Getter method for the the property contentFilter. |
DocumentDataAccessor |
getDataAccessor()
Getter method for the the property dataAccessor. |
com.lowagie.text.Document |
getDocument()
Gets the document. |
com.lowagie.text.Document |
getDocument(boolean openDocumentRequired)
Gets the document. |
com.lowagie.text.DocWriter |
getDocumentWriter()
Gets the document writer. |
com.lowagie.text.DocWriter |
getDocumentWriter(boolean openDocumentRequired)
Gets the document writer. |
DynamicContentContainer |
getDynamicContentContainer()
Getter method for the the property dynamicContentContainer. |
int |
getExpectedNumberOfPages()
Getter method for the the property expectedNumberOfPages. |
DocumentFont |
getFont(String name)
Gets the font with the given name. |
com.lowagie.text.pdf.FontMapper |
getFontMapper()
Gets the font mapper, required for PDF rendering using the Graphics2D interface. |
FormatHelper |
getFormatHelper()
Gets the format helper. |
org.apache.commons.logging.Log |
getLog()
Getter method for the the property log. |
DocumentMetaData |
getMetaData()
Gets the meta data. |
List |
getOutlines()
Gets the list of outline items. |
com.lowagie.text.pdf.PdfPageEvent |
getPageEventHandler()
Gets the current page event handler. |
int |
getPageNumber(com.lowagie.text.pdf.PdfWriter writer)
Gets the current page number. |
int |
getPageNumberOffset()
Getter method for the the property pageNumberOffset. |
TrueTypeFontHolder |
getRegisteredFont(String name)
Gets a specific registered font. |
TrueTypeFontHolder[] |
getRegisteredFonts()
Gets an array holding all registerd fonts. |
Object |
getResource(Object key)
Gets a document resource from the registry. |
Map |
getResourceRegistry()
Gets a the resource registry. |
Map |
getStyle(BaseDocumentTag tag,
String clazz)
Gets the style attributes for the given style class name. |
Map |
getStyle(String styleName)
Gets the style attributes for the given style name. |
StyleParser |
getStyleParser()
Getter method for the the property styleParser. |
AttributeDefinitionMap |
getSupportedAttributes(BaseDocumentTag tag)
Gets the supported attribute definition map for the given tag instance. |
ChildDefinitionMap |
getSupportedChilds(BaseDocumentTag tag)
Gets the supported style attribute definition map for the given tag instance. |
AttributeDefinitionMap |
getSupportedStyleAttributes(BaseDocumentTag tag)
Gets the supported style attribute definition map for the given tag instance. |
DocumentTagFactory |
getTagFactory()
Gets the tag factory. |
DocumentTagInterceptor |
getTagInterceptor()
Getter method for the the property tagInterceptor. |
TemplateContext |
getTemplateContext()
Gets the template context. |
PrintWriter |
getTemplateCopyWriter()
Getter method for the the property templateCopyWriter. |
List |
getTocItems()
Gets the list of TOC items. |
float |
getVerticalPosition()
Gets the vertical position on the current page. |
String |
getXmlReaderClass()
Getter method for the the property xmlReaderClass. |
boolean |
isCacheImages()
Getter method for the the property cacheImages. |
boolean |
isDestinationsSupported()
Getter method for the the property destinationsSupported. |
boolean |
isEvaluateExpressions()
Getter method for the the property evaluateExpressions. |
boolean |
isIncludeHeadSection()
Getter method for the the property includeHeadSection. |
boolean |
isParseDynamicContent()
Getter method for the the property parseDynamicContent. |
boolean |
isStrictlyCheckDocumentStructure()
Getter method for the the property strictlyCheckDocumentStructure. |
boolean |
isTocFreezed()
Getter method for the the property tocFreezed. |
boolean |
isTranslateEscapeSequences()
Getter method for the the property translateEscapeSequences. |
CellContainer |
latestCellContainer()
Gets the first item from the top of the stack that implements the CellContainer interface. |
CommonAttributesHolder |
latestCommonAttributesHolder()
Gets the first item from the top of the stack that implements the CommonAttributesHolder interface. |
Condition |
latestCondition()
Gets the first item from the top of the stack that implements the Condition interface. |
ElementContainer |
latestElementContainer()
Gets the first item from the top of the stack that implements the ElementContainer interface. |
FontHolder |
latestFontHolder()
Gets the first item from the top of the stack that implements the FontHolder interface. |
BaseDocumentTag |
latestOfType(Class type)
Gets the first item from the top of the stack that matches the given type name. |
BaseDocumentTag |
latestOfType(String type)
Gets the first item from the top of the stack that matches the given type name. |
PdfCellContainer |
latestPdfCellContainer()
Gets the first item from the top of the stack that implements the PdfCellContainer interface. |
PhraseHolder |
latestPhraseHolder()
Gets the first item from the top of the stack that implements the PhraseHolder interface. |
BaseDocumentTag |
latestRealTag()
Gets the first item from the top of the stack that is no virtual container. |
byte[] |
loadResource(String location)
Loads the resource from the given loacation. |
Locator |
locator()
Gets the document locator. |
Format |
lookupFormat(String formatString)
Looks up the macro definition for the given macro name. |
MacroDefTag |
lookupMacroDefinition(String macroName)
Looks up the macro definition for the given macro name. |
int |
numItems()
Gets number of items, currently on the document stack. |
DocumentEventRecorder |
popEventRecorder()
Pops the top item from the event recorder stack. |
BaseDocumentTag |
popItem()
Pops the top item from the document stack. |
void |
pushEventRecorder(DocumentEventRecorder recorder)
Pushes an item on the event recorder stack. |
void |
pushItem(BaseDocumentTag item)
Pushes an item on the document stack. |
void |
registerColor(String colorName,
Color color)
Registers the given color for the also given name. |
void |
registerFont(String fontName,
byte[] fontBytes,
int style,
boolean embed,
boolean cached)
Registers the given true type font for the also given font name and style. |
void |
registerFont(String name,
DocumentFont font)
Registers the font with the given name. |
void |
registerFormat(String formatString,
Format formatInstance)
Registers the given format instance for the also given format string. |
void |
registerMacroDefinition(String macroName,
MacroDefTag macroDefinition)
Registers the given macro definition instance for the also given macro name. |
void |
registerResource(Object key,
Object resource)
Registers a document resource from the registry. |
void |
registerStyle(String styleName,
Map attributes)
Registers the specified style attributes for the given name. |
void |
removePageEventHandler(Object key)
Removes the handler with the given name from the event handler map. |
Object |
removeResource(Object key)
Removes a document resource from the registry. |
protected void |
reset(OutputStream outputStream)
Resets the document handler. |
void |
resetReferences()
Resets all references. |
void |
setAttributeHandler(AttributeHandler attributeHandler)
Setter method for the the property attributeHandler. |
void |
setCacheImages(boolean cacheImages)
Setter method for the the property cacheImages. |
void |
setContentFilter(ContentFilter contentFilter)
Setter method for the the property contentFilter. |
protected void |
setDataAccessor(DocumentDataAccessor dataAccessor)
Setter method for the the property dataAccessor. |
void |
setDestinationsSupported(boolean destinationsSupported)
Setter method for the the property destinationsSupported. |
com.lowagie.text.DocWriter |
setDocument(com.lowagie.text.Document document)
Sets the document and initializes the document writer. |
com.lowagie.text.DocWriter |
setDocumentAndWriter(com.lowagie.text.Document document,
com.lowagie.text.DocWriter writer)
Sets the document and the document writer. |
com.lowagie.text.DocWriter |
setDocumentAndWriter(com.lowagie.text.Document document,
com.lowagie.text.DocWriter writer,
Map resourceRegistry,
com.lowagie.text.pdf.PdfPageEvent eventHandler)
Sets the document and the document writer. |
void |
setDocumentLocator(Locator locator)
Sets the document locator. |
void |
setDynamicContentContainer(DynamicContentContainer dynamicContentContainer)
Setter method for the the property dynamicContentContainer. |
void |
setEvaluateExpressions(boolean evaluateExpressions)
Setter method for the the property evaluateExpressions. |
void |
setExpectedNumberOfPages(int expectedNumberOfPages)
Setter method for the the property expectedNumberOfPages. |
protected void |
setIncludeHeadSection(boolean includeHeadSection)
Setter method for the the property includeHeadSection. |
void |
setLog(org.apache.commons.logging.Log log)
Setter method for the the property log. |
void |
setLogicalPageNumberStyle(int logicalPageNumberStyle)
Sets the current logical page numbering style. |
void |
setLogicalPageNumberText(String logicalPageNumberText)
Sets the current logical page numbering text. |
void |
setMetaData(DocumentMetaData metaData)
Sets the meta data. |
void |
setPageEventHandler(Object key,
com.lowagie.text.pdf.PdfPageEvent handler)
Sets the given handler to the event handler map. |
void |
setPageNumberOffset(int pageNumberOffset)
Setter method for the the property pageNumberOffset. |
void |
setParseDynamicContent(boolean parseDynamicContent)
Setter method for the the property parseDynamicContent. |
void |
setResourceLoader(ResourceLoader resourceLoader)
Adds a resource loader. |
void |
setStrictlyCheckDocumentStructure(boolean strictlyCheckDocumentStructure)
Setter method for the the property strictlyCheckDocumentStructure. |
void |
setStyleParser(StyleParser styleParser)
Setter method for the the property styleParser. |
void |
setTagInterceptor(DocumentTagInterceptor tagInterceptor)
Setter method for the the property tagInterceptor. |
void |
setTemplateContext(TemplateContext templateContext)
Sets the template context. |
protected void |
setTemplateCopyWriter(PrintWriter templateCopyWriter)
Setter method for the the property templateCopyWriter. |
void |
setTocFreezed(boolean tocFreezed)
Setter method for the the property tocFreezed. |
void |
setTranslateEscapeSequences(boolean translateEscapeSequences)
Setter method for the the property translateEscapeSequences. |
void |
setXmlReaderClass(String xmlReaderClass)
Setter method for the the property xmlReaderClass. |
void |
startDocument()
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
|
DocumentEventRecorder |
topEventRecorder()
Gets the top item from the event recorder stack. |
BaseDocumentTag |
topItem()
Gets the top item from the document stack. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.lowagie.text.pdf.PdfPageLabels pdfLabels
Constructor Detail |
---|
public DocumentHandler(OutputStream outputStream, TemplateContext templateContext, DocumentTagFactory tagFactory)
outputStream
- The stream where to write the document to.templateContext
- The template context to use.tagFactory
- The special tag factory to use.public DocumentHandler(OutputStream outputStream, TemplateInterpreter templateInterpreter, TemplateContext templateContext, DocumentTagFactory tagFactory)
outputStream
- The stream where to write the document to.templateInterpreter
- The template interpreter to use.templateContext
- The template context to use.tagFactory
- The special tag factory to use.Method Detail |
---|
public void setLogicalPageNumberStyle(int logicalPageNumberStyle)
logicalPageNumberStyle
- The style value for the logical page numbering.
this value can be DECIMAL_ARABIC_NUMERALS = 0 which is the default
UPPERCASE_ROMAN_NUMERALS = 1 (I, II, III, IV etc)
LOWERCASE_ROMAN_NUMERALS = 2 (i, ii, iii, iv etc)
UPPERCASE_LETTERS = 3 (A,B,C,D etc)
LOWERCASE_LETTERS = 4 (a,b,c,d etc)
EMPTY = 5 (No logical page numbers are generated but fixed text may still exist)public void setLogicalPageNumberText(String logicalPageNumberText)
logicalPageNumberText
- The text that is prepended to the logical page numbering style.public void applyCurrentLogicalPageNumberStyle()
#setLogicalPageNumberStyle(int, String)
,
logicalPageNumberStyle
,
logicalPageNumberText
public int getPageNumber(com.lowagie.text.pdf.PdfWriter writer)
writer
- The document writer.
protected void reset(OutputStream outputStream)
outputStream
- The stream where to write the document to.public org.apache.commons.logging.Log getLog()
public void setLog(org.apache.commons.logging.Log log)
log
- The value to set for the property log.public String getXmlReaderClass()
public void setXmlReaderClass(String xmlReaderClass)
xmlReaderClass
- The value to set for the property xmlReaderClass.public FormatHelper getFormatHelper()
public void setResourceLoader(ResourceLoader resourceLoader)
resourceLoader
- The resource loader to add.public byte[] loadResource(String location) throws IOException
location
- The location from which to load the resource.
IOException
- In case the loading of the resource failed.public void registerStyle(String styleName, Map attributes)
styleName
- The style name.attributes
- The attributes to register.public Map getStyle(String styleName)
styleName
- The style name.
public Map getStyle(BaseDocumentTag tag, String clazz)
tag
- The tag to retrive the style for.clazz
- The style class names, separated by blank.
public void registerColor(String colorName, Color color)
registerColor
in interface ColorRegistry
colorName
- The color name.color
- The color to register.public Color getColor(String colorName)
getColor
in interface ColorRegistry
colorName
- The color name.
public void registerFont(String fontName, byte[] fontBytes, int style, boolean embed, boolean cached) throws IOException, com.lowagie.text.DocumentException
fontName
- The font name.fontBytes
- The TTF font data.style
- The base font style (NORMAL,BOLD,ITALIC,BOLD|ITALIC).embed
- Tells whether or not to embed the font into the PDF (Added by Kiran).cached
- Tells whether or not to cache the font (Added by Kiran).
IOException
- In case the base font creation failed.
com.lowagie.text.DocumentException
- In case the base font creation failed.public DocumentFont createFont(String fontName, String encoding, float size, int style, float textRise, Color color) throws DocumentHandlerException
fontName
- The font name. This may be a comma separated list of font names.encoding
- The font encoding.size
- The desired font size.style
- The font style (NORMAL, BOLD, ITALIC ...).color
- The font color.textRise
- The text displacement relative to the baseline.
Positive values rise the text, negative values lower the text.
DocumentHandlerException
- In case the font could not be created.public com.lowagie.text.pdf.BaseFont getBaseFont(String fontName, int style)
fontName
- The font name.style
- The font style (NORMAL, BOLD, ITALIC ...).
public Font getAwtFont(DocumentFont font)
font
- The document font for which to create the AWT font.
public TrueTypeFontHolder[] getRegisteredFonts()
public TrueTypeFontHolder getRegisteredFont(String name)
name
- The name of the desired font.
public com.lowagie.text.pdf.FontMapper getFontMapper()
public com.lowagie.text.Image getCachedImage(Object source)
source
- The image source.
public void cacheImage(Object source, com.lowagie.text.Image img)
source
- The image source.img
- The image to put into cache.public AttributeDefinitionMap getSupportedAttributes(BaseDocumentTag tag)
tag
- The tag to get the supported attributes for.
public AttributeDefinitionMap getSupportedStyleAttributes(BaseDocumentTag tag)
tag
- The tag to get the supported attributes for.
public ChildDefinitionMap getSupportedChilds(BaseDocumentTag tag)
tag
- The tag to get the supported attributes for.
public com.lowagie.text.pdf.PdfPageEvent getPageEventHandler()
public com.lowagie.text.pdf.PdfPageEvent createPageEventHandler()
public void setPageEventHandler(Object key, com.lowagie.text.pdf.PdfPageEvent handler)
queue
and a handler
for the given key is currently assigned, it puts the handler to the queue map.
key
- The event handler key.handler
- The event handler.public void removePageEventHandler(Object key)
key
- The event handler key.public void clearPageEventHandlers()
public TemplateContext getTemplateContext()
public void setTemplateContext(TemplateContext templateContext)
templateContext
- The template context to set.public DocumentTagFactory getTagFactory()
public boolean isTranslateEscapeSequences()
public void setTranslateEscapeSequences(boolean translateEscapeSequences)
translateEscapeSequences
- The value to set for the property translateEscapeSequences.public boolean isParseDynamicContent()
public void setParseDynamicContent(boolean parseDynamicContent)
parseDynamicContent
- The value to set for the property parseDynamicContent.public boolean isEvaluateExpressions()
public void setEvaluateExpressions(boolean evaluateExpressions)
evaluateExpressions
- The value to set for the property evaluateExpressions.public boolean isCacheImages()
public void setCacheImages(boolean cacheImages)
cacheImages
- The value to set for the property cacheImages.public boolean isStrictlyCheckDocumentStructure()
public void setStrictlyCheckDocumentStructure(boolean strictlyCheckDocumentStructure)
strictlyCheckDocumentStructure
- The value to set for the property strictlyCheckDocumentStructure.public int getExpectedNumberOfPages()
public void setExpectedNumberOfPages(int expectedNumberOfPages)
expectedNumberOfPages
- The value to set for the property expectedNumberOfPages.public boolean isIncludeHeadSection()
protected void setIncludeHeadSection(boolean includeHeadSection)
includeHeadSection
- The value to set for the property includeHeadSection.public String executeTemplate(String templateSource) throws TemplateException
templateSource
- The template source to execute.
TemplateException
- If the expression could not be successfuly resolvedpublic boolean evalBoolean(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic int evalInt(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic long evalLong(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic float evalFloat(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic double evalDouble(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic Date evalDate(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic Time evalTime(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic Timestamp evalTimestamp(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic String evalString(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic Object evalObject(String expression) throws ExpressionException
expression
- The expression to evaluate.
ExpressionException
- If the expression could not be successfuly resolvedpublic void registerFormat(String formatString, Format formatInstance)
formatString
- The format string.formatInstance
- The format instance.public Format lookupFormat(String formatString)
formatString
- The format string.
public void registerMacroDefinition(String macroName, MacroDefTag macroDefinition)
macroName
- The macro name.macroDefinition
- The macro definition instance.public MacroDefTag lookupMacroDefinition(String macroName)
macroName
- The macro name.
public void pushItem(BaseDocumentTag item)
item
- The new item on top of the stack.public BaseDocumentTag popItem()
public BaseDocumentTag topItem()
public void pushEventRecorder(DocumentEventRecorder recorder)
recorder
- The new item on top of the stack.public DocumentEventRecorder popEventRecorder()
public DocumentEventRecorder topEventRecorder()
public BaseDocumentTag latestOfType(String type)
type
- The name of the tag to look for.
public BaseDocumentTag latestRealTag()
public BaseDocumentTag latestOfType(Class type)
type
- The class of the tag to look for.
public ElementContainer latestElementContainer()
public CellContainer latestCellContainer()
public PdfCellContainer latestPdfCellContainer()
public Condition latestCondition()
public FontHolder latestFontHolder()
public PhraseHolder latestPhraseHolder()
public CommonAttributesHolder latestCommonAttributesHolder()
public int numItems()
public com.lowagie.text.Document getDocument()
public com.lowagie.text.Document getDocument(boolean openDocumentRequired) throws DocumentHandlerException
openDocumentRequired
- True, if an open document is required, else false.
DocumentHandlerException
- In case no document has been set so far.public com.lowagie.text.DocWriter setDocument(com.lowagie.text.Document document) throws DocumentHandlerException
document
- The document.
DocumentHandlerException
- In case the document writer could not be initialized.public com.lowagie.text.DocWriter setDocumentAndWriter(com.lowagie.text.Document document, com.lowagie.text.DocWriter writer)
document
- The document.writer
- The document writer.
public com.lowagie.text.DocWriter setDocumentAndWriter(com.lowagie.text.Document document, com.lowagie.text.DocWriter writer, Map resourceRegistry, com.lowagie.text.pdf.PdfPageEvent eventHandler)
document
- The document.writer
- The document writer.resourceRegistry
- The resource registry to set.eventHandler
- The page event handler to set.
public com.lowagie.text.DocWriter getDocumentWriter()
public com.lowagie.text.DocWriter getDocumentWriter(boolean openDocumentRequired)
openDocumentRequired
- True, if an open document is required, else false.
public Locator locator()
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
locator
- The document locator.public void registerFont(String name, DocumentFont font)
name
- The font name.font
- The font to be registered.public DocumentFont getFont(String name) throws TagAttributeException
name
- The font name.
TagAttributeException
- If the desired font was not defined.public List getTocItems()
null
.
public void addTocItem(TocItem tocItem)
tocItem
- The TOC item to add.public List getOutlines()
null
.
public void addOutline(OutlineItem outlineItem)
outlineItem
- The outline item to add.protected TocItem flushTocChapter(com.lowagie.text.pdf.PdfWriter writer, float verticalPosition)
writer
- The PDF writer to use.verticalPosition
- The vertical position of the chapter title.
protected TocItem flushTocSection(com.lowagie.text.pdf.PdfWriter writer, float verticalPosition)
writer
- The PDF writer to use.verticalPosition
- The vertical position of the chapter title.
protected void flushTocItems(com.lowagie.text.pdf.PdfWriter writer)
writer
- The PDF writer to use.public DocumentDataAccessor getDataAccessor()
protected void setDataAccessor(DocumentDataAccessor dataAccessor)
dataAccessor
- The value to set for the property dataAccessor.public DocumentTagInterceptor getTagInterceptor()
public void setTagInterceptor(DocumentTagInterceptor tagInterceptor)
tagInterceptor
- The value to set for the property tagInterceptor.public ContentFilter getContentFilter()
public void setContentFilter(ContentFilter contentFilter)
contentFilter
- The value to set for the property contentFilter.public Map getResourceRegistry()
public Object getResource(Object key)
key
- The key of the document resource to get.
public void registerResource(Object key, Object resource)
key
- The key of the document resource to register.resource
- The resource to register.public Object removeResource(Object key)
key
- The key of the document resource to remove.
public DynamicContentContainer getDynamicContentContainer()
public void setDynamicContentContainer(DynamicContentContainer dynamicContentContainer)
dynamicContentContainer
- The value to set for the property dynamicContentContainer.public float getVerticalPosition()
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
ContentHandler.startDocument()
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
ContentHandler.characters(char[], int, int)
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
ContentHandler.endDocument()
public PrintWriter getTemplateCopyWriter()
protected void setTemplateCopyWriter(PrintWriter templateCopyWriter)
templateCopyWriter
- The value to set for the property templateCopyWriter.public void disableTemplateCopyWriter()
public void enableTemplateCopyWriter()
public AttributeHandler getAttributeHandler()
public void setAttributeHandler(AttributeHandler attributeHandler)
attributeHandler
- The value to set for the property attributeHandler.public StyleParser getStyleParser()
public void setStyleParser(StyleParser styleParser)
styleParser
- The value to set for the property styleParser.public int getPageNumberOffset()
public void setPageNumberOffset(int pageNumberOffset)
pageNumberOffset
- The value to set for the property pageNumberOffset.public void clearReferences()
public void resetReferences()
public boolean isTocFreezed()
public void setTocFreezed(boolean tocFreezed)
tocFreezed
- The value to set for the property tocFreezed.public boolean isDestinationsSupported()
public void setDestinationsSupported(boolean destinationsSupported)
destinationsSupported
- The value to set for the property destinationsSupported.public DocumentMetaData getMetaData()
public void setMetaData(DocumentMetaData metaData)
metaData
- The meta data to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |