org.allcolor.yahp.cl.converter.firefox
Class CFirefoxHtmlRenderer

java.lang.Object
  extended by org.allcolor.yahp.cl.converter.firefox.CFirefoxHtmlRenderer

public final class CFirefoxHtmlRenderer
extends java.lang.Object

This class send an HTML document to be rendered in PS by Mozilla firefox and converted in PDF by ps2pdf. Firefox must be patched with the furnished yahp patch for this to work. Options for header/footer &T : Title &U : Document URL &D : Date/Time &P : Page Number &PT : Page Number "of" Page Total

Version:
0.94
Author:
Quentin Anciaux

Nested Class Summary
private static class CFirefoxHtmlRenderer.CStreamReader
          Read a stream in a separate thread.
 
Field Summary
private static org.apache.log4j.Logger log
          Use for logging
 
Constructor Summary
private CFirefoxHtmlRenderer()
          Constructor for the CFirefoxHtmlRenderer object
 
Method Summary
static void renderToPDF(IHtmlToPdfTransformer.PageSize size, java.lang.String file, java.lang.String fbase_url, java.util.List hf, java.util.Map properties, java.io.OutputStream fout)
          Render the document in a pdf.
private  java.io.File saveDocument(java.lang.String sfile, java.lang.String base_url)
          Sets the document attribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.log4j.Logger log
Use for logging

Constructor Detail

CFirefoxHtmlRenderer

private CFirefoxHtmlRenderer()
Constructor for the CFirefoxHtmlRenderer object

Method Detail

renderToPDF

public static final void renderToPDF(IHtmlToPdfTransformer.PageSize size,
                                     java.lang.String file,
                                     java.lang.String fbase_url,
                                     java.util.List hf,
                                     java.util.Map properties,
                                     java.io.OutputStream fout)
                              throws IHtmlToPdfTransformer.CConvertException
Render the document in a pdf.

Parameters:
size - page size
file - document
fbase_url - base url of the document
hf - headers footers list
properties - transform properties
fout - outputstream to write into
Throws:
IHtmlToPdfTransformer.CConvertException - if an error occurs while rendering

saveDocument

private final java.io.File saveDocument(java.lang.String sfile,
                                        java.lang.String base_url)
                                 throws IHtmlToPdfTransformer.CConvertException
Sets the document attribute

Parameters:
sfile - The new document value
base_url - The base uri value
Returns:
A file containing the document
Throws:
IHtmlToPdfTransformer.CConvertException - if an error occurs