|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.allcolor.yahp.cl.converter.swing.CSwingHtmlRenderer
public final class CSwingHtmlRenderer
This class render an HTML document in a pdf graphics 2D. It use a JTextPane for html rendering.
Nested Class Summary | |
---|---|
static class |
CSwingHtmlRenderer.CFormView
This class is used to render Form components. |
static class |
CSwingHtmlRenderer.CImageView
This class extends ImageView and prevent images to be painted while painting root container, thus letting YaHP calculates correct page cutting. |
static class |
CSwingHtmlRenderer.CInlineView
This class extends InlineView and prevent text to be painted while painting root container, thus letting YaHP calculates correct page cutting. |
private static class |
CSwingHtmlRenderer.CInputButtonRenderer
Render a button |
private static class |
CSwingHtmlRenderer.CInputCheckBoxRenderer
Render a checkbox |
private static class |
CSwingHtmlRenderer.CInputRadioRenderer
Render a radio button |
private static class |
CSwingHtmlRenderer.CInputTextFieldRenderer
Render an input text field |
private static class |
CSwingHtmlRenderer.CSelectComboBoxRenderer
Render a combobox |
private static class |
CSwingHtmlRenderer.CSelectListBoxRenderer
Render a list box |
private static class |
CSwingHtmlRenderer.CTextareaRenderer
Render a textarea |
static class |
CSwingHtmlRenderer.CView
DOCUMENT ME! |
private static class |
CSwingHtmlRenderer.SynchronousEditorKit
An html editor kit which load images synchronously. |
private static class |
CSwingHtmlRenderer.SynchronousViewFactory
A view factory for the synchronous editor kit. |
Field Summary | |
---|---|
private static java.util.Map |
loadedFont
|
private static org.apache.log4j.Logger |
log
Use for logging |
private javax.swing.JTextPane |
panel
The panel to render the html doc |
Constructor Summary | |
---|---|
private |
CSwingHtmlRenderer()
Constructor for the CSwingHtmlRenderer object |
Method Summary | |
---|---|
private java.awt.Rectangle |
getMinimumSize(int width)
return the size image needed to render the document without anything going off the side. could be different than the dimensions passed into layout because of text that couldn't break or a table that's set to be too big |
private static void |
initFont(org.apache.fop.fonts.FontInfo info,
java.util.Map properties)
Init font embedding for fop |
private boolean |
isInBody(org.w3c.dom.Node fnode)
Return true if node is in the body section |
private void |
layout(java.awt.Dimension dim)
Layout the document |
private static CTextPanePrinter |
layoutDocument(org.w3c.dom.Document doc,
java.lang.String base_url,
int[] wh,
int width)
|
private static void |
registerTTFFile(java.util.List fonts,
java.io.File f)
|
private static void |
renderHeaderFooter(java.lang.String urlForBase,
java.util.List hf,
java.awt.Graphics2D g,
int pagenum,
int pagetotal,
IHtmlToPdfTransformer.PageSize size)
Render the header/footer on the current page |
static void |
renderToPDF(IHtmlToPdfTransformer.PageSize size,
org.w3c.dom.Document node,
java.lang.String fbase_url,
java.util.List hf,
java.util.Map properties,
java.io.OutputStream out)
Render the document in a pdf. |
private void |
setDocument(org.w3c.dom.Document node,
java.lang.String base_url)
Sets the document attribute |
private void |
validateForSwingHtmlComponent(org.w3c.dom.Node fnode,
java.lang.String fbase_url,
org.allcolor.css.parser.CStyler styler)
Remove problematic node, translate img uri to absolute. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger log
private static final java.util.Map loadedFont
private javax.swing.JTextPane panel
Constructor Detail |
---|
private CSwingHtmlRenderer()
Method Detail |
---|
private static CTextPanePrinter layoutDocument(org.w3c.dom.Document doc, java.lang.String base_url, int[] wh, int width)
public static final void renderToPDF(IHtmlToPdfTransformer.PageSize size, org.w3c.dom.Document node, java.lang.String fbase_url, java.util.List hf, java.util.Map properties, java.io.OutputStream out) throws IHtmlToPdfTransformer.CConvertException
size
- page sizenode
- documentfbase_url
- base url of the documenthf
- headers footers listproperties
- transform propertiesout
- outputstream to write into
IHtmlToPdfTransformer.CConvertException
- if an error occurs while renderingprivate static void registerTTFFile(java.util.List fonts, java.io.File f)
private static void initFont(org.apache.fop.fonts.FontInfo info, java.util.Map properties)
info
- PDF fop font info object.private final void setDocument(org.w3c.dom.Document node, java.lang.String base_url)
node
- The new document valuebase_url
- The base uri valueprivate final boolean isInBody(org.w3c.dom.Node fnode)
fnode
- node to check
private final java.awt.Rectangle getMinimumSize(int width)
width
- page with
private final void layout(java.awt.Dimension dim)
dim
- page sizeprivate static final void renderHeaderFooter(java.lang.String urlForBase, java.util.List hf, java.awt.Graphics2D g, int pagenum, int pagetotal, IHtmlToPdfTransformer.PageSize size)
urlForBase
- base url of the html documenthf
- header-footer listg
- pdf graphics2dpagenum
- current page numberpagetotal
- total pagesize
- pdf page sizeprivate final void validateForSwingHtmlComponent(org.w3c.dom.Node fnode, java.lang.String fbase_url, org.allcolor.css.parser.CStyler styler)
fnode
- current nodefbase_url
- document base url
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |