org.allcolor.yahp.cl.converter
Class CHtmlToPdfOOoTransformer

java.lang.Object
  extended by org.allcolor.yahp.cl.converter.CHtmlToPdfOOoTransformer
All Implemented Interfaces:
IHtmlToPdfTransformer

public final class CHtmlToPdfOOoTransformer
extends java.lang.Object
implements IHtmlToPdfTransformer

This class transform an html document in a PDF.

Version:
0.94
Author:
Quentin Anciaux

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.allcolor.yahp.converter.IHtmlToPdfTransformer
IHtmlToPdfTransformer.CConvertException, IHtmlToPdfTransformer.CHeaderFooter, IHtmlToPdfTransformer.PageSize
 
Field Summary
 
Fields inherited from interface org.allcolor.yahp.converter.IHtmlToPdfTransformer
A0L, A0P, A10L, A10P, A11L, A11P, A12L, A12P, A13L, A13P, A14L, A14P, A1L, A1P, A2L, A2P, A3L, A3P, A4L, A4P, A5L, A5P, A6L, A6P, A7L, A7P, A8L, A8P, A9L, A9P, DEFAULT_PDF_RENDERER, FIREFOX_PDF_RENDERER, FIREFOX_PRINT_SCRIPT_PATH, FOP_TTF_FONT_PATH, HANDLE_CHAR_AS_GLYPH, OOO_PDF_HOST, OOO_PDF_PORT, OOO_PDF_RENDERER, PDF_ALLOW_ASSEMBLY, PDF_ALLOW_COPY, PDF_ALLOW_DEGRADED_PRINTING, PDF_ALLOW_FILLIN, PDF_ALLOW_MODIFT_ANNOTATIONS, PDF_ALLOW_MODIFY_CONTENTS, PDF_ALLOW_PRINTING, PDF_ALLOW_SCREEN_READERS, PDF_AUTHOR, PDF_CREATOR, PDF_ENCRYPTION_PASSWORD, PDF_PRODUCER, PDF_RENDERER_CLASS, PDF_SIGNING_KEYSTORE_PASSWORD, PDF_SIGNING_LOCATION, PDF_SIGNING_PRIVATE_KEY_FILE, PDF_SIGNING_PRIVATE_KEY_PASSWORD, PDF_SIGNING_REASON, PDF_TITLE, USE_PDF_ENCRYPTION, USE_PDF_SELF_SIGNING, USE_PDF_SIGNING, VERSION
 
Constructor Summary
CHtmlToPdfOOoTransformer()
          Creates a new CHtmlToPdfOOoTransformer object.
 
Method Summary
private  java.lang.String loadFile(java.io.InputStream in, java.lang.String urlForBase)
          Load the file from an inputstream
private  java.lang.String removeBaseIfPresent(java.lang.String fin)
          Set the Content-Type meta tag
 java.lang.String setCharset(java.lang.String fin)
          Set the Content-Type meta tag
 void transform(java.io.InputStream in, java.lang.String urlForBase, IHtmlToPdfTransformer.PageSize size, java.util.List hf, java.util.Map properties, java.io.OutputStream out)
          Transform the html document in the inputstream to a pdf in the outputstream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CHtmlToPdfOOoTransformer

public CHtmlToPdfOOoTransformer()
Creates a new CHtmlToPdfOOoTransformer object.

Method Detail

transform

public final void transform(java.io.InputStream in,
                            java.lang.String urlForBase,
                            IHtmlToPdfTransformer.PageSize size,
                            java.util.List hf,
                            java.util.Map properties,
                            java.io.OutputStream out)
                     throws IHtmlToPdfTransformer.CConvertException
Transform the html document in the inputstream to a pdf in the outputstream

Specified by:
transform in interface IHtmlToPdfTransformer
Parameters:
in - html document stream
urlForBase - base url of the document
size - not used ! not supported !
hf - not used ! not supported !
properties - transform properties
out - out stream to the pdf file
Throws:
CConvertException - if a conversion error occured
IHtmlToPdfTransformer.CConvertException

setCharset

public java.lang.String setCharset(java.lang.String fin)
Set the Content-Type meta tag

Parameters:
fin - content of the file
Returns:
content of the file + the meta tag set

loadFile

private java.lang.String loadFile(java.io.InputStream in,
                                  java.lang.String urlForBase)
                           throws java.io.IOException
Load the file from an inputstream

Parameters:
in - the stream to load
urlForBase - the base url of the document
Returns:
the content of the stream in a string
Throws:
java.io.IOException - if an error occurs

removeBaseIfPresent

private java.lang.String removeBaseIfPresent(java.lang.String fin)
Set the Content-Type meta tag

Parameters:
fin - content of the file
Returns:
content of the file + the meta tag set