org.allcolor.yahp.converter
Interface IHtmlToPdfTransformer

All Known Implementing Classes:
CHtmlToPdfFirefoxTransformer, CHtmlToPdfFlyingSaucerTransformer, CHtmlToPdfOOoTransformer, CHtmlToPdfSwingTransformer

public interface IHtmlToPdfTransformer

Interface for an html to pdf transformer.

Version:
1.2.17
Author:
Quentin Anciaux

Nested Class Summary
static class IHtmlToPdfTransformer.CConvertException
          An exception indicating a conversion error.
static class IHtmlToPdfTransformer.CHeaderFooter
          Represent a Header or a Footer
static class IHtmlToPdfTransformer.PageSize
          A class to setup the size of a pdf page.
 
Field Summary
static IHtmlToPdfTransformer.PageSize A0L
          A0 landscape size
static IHtmlToPdfTransformer.PageSize A0P
          A0 portrait size
static IHtmlToPdfTransformer.PageSize A10L
          A10 landscape size
static IHtmlToPdfTransformer.PageSize A10P
          A10 portrait size
static IHtmlToPdfTransformer.PageSize A11L
          A11 landscape size
static IHtmlToPdfTransformer.PageSize A11P
          A11 portrait size
static IHtmlToPdfTransformer.PageSize A12L
          A12 landscape size
static IHtmlToPdfTransformer.PageSize A12P
          A12 portrait size
static IHtmlToPdfTransformer.PageSize A13L
          A13 landscape size
static IHtmlToPdfTransformer.PageSize A13P
          A13 portrait size
static IHtmlToPdfTransformer.PageSize A14L
          A14 landscape size
static IHtmlToPdfTransformer.PageSize A14P
          A14 portrait size
static IHtmlToPdfTransformer.PageSize A1L
          A1 landscape size
static IHtmlToPdfTransformer.PageSize A1P
          A1 portrait size
static IHtmlToPdfTransformer.PageSize A2L
          A2 landscape size
static IHtmlToPdfTransformer.PageSize A2P
          A2 portrait size
static IHtmlToPdfTransformer.PageSize A3L
          A3 landscape size
static IHtmlToPdfTransformer.PageSize A3P
          A3 portrait size
static IHtmlToPdfTransformer.PageSize A4L
          A4 landscape size
static IHtmlToPdfTransformer.PageSize A4P
          A4 portrait size
static IHtmlToPdfTransformer.PageSize A5L
          A5 landscape size
static IHtmlToPdfTransformer.PageSize A5P
          A5 portrait size
static IHtmlToPdfTransformer.PageSize A6L
          A6 landscape size
static IHtmlToPdfTransformer.PageSize A6P
          A6 portrait size
static IHtmlToPdfTransformer.PageSize A7L
          A7 landscape size
static IHtmlToPdfTransformer.PageSize A7P
          A7 portrait size
static IHtmlToPdfTransformer.PageSize A8L
          A8 landscape size
static IHtmlToPdfTransformer.PageSize A8P
          A8 portrait size
static IHtmlToPdfTransformer.PageSize A9L
          A9 landscape size
static IHtmlToPdfTransformer.PageSize A9P
          A9 portrait size
static java.lang.String DEFAULT_PDF_RENDERER
          Default PDF renderer class, use swing to render HTML.
static java.lang.String FIREFOX_PDF_RENDERER
          PDF renderer class, use Mozilla Firefox to render HTML.
static java.lang.String FIREFOX_PRINT_SCRIPT_PATH
          Firefox 'fireprint' script path..
static java.lang.String FLYINGSAUCER_PDF_RENDERER
          PDF renderer class, use Flying Saucer Project to render HTML.
static java.lang.String FOP_TTF_FONT_PATH
          Path to TTF font for embedding with FOP
static java.lang.String HANDLE_CHAR_AS_GLYPH
          If you'll convert non-latin html document, you can set this property to true or embed fonts.
static java.lang.String OOO_PDF_HOST
          OpenOffice listener hostname, default is localhost
static java.lang.String OOO_PDF_PORT
          OpenOffice listener port, default is 8100
static java.lang.String OOO_PDF_RENDERER
          PDF renderer class, use OpenOffice.org to render HTML.
static java.lang.String PDF_ALLOW_ASSEMBLY
          The operation permitted when the document is opened with the user password.
static java.lang.String PDF_ALLOW_COPY
          The operation permitted when the document is opened with the user password.
static java.lang.String PDF_ALLOW_DEGRADED_PRINTING
          The operation permitted when the document is opened with the user password.
static java.lang.String PDF_ALLOW_FILLIN
          The operation permitted when the document is opened with the user password.
static java.lang.String PDF_ALLOW_MODIFT_ANNOTATIONS
          The operation permitted when the document is opened with the user password.
static java.lang.String PDF_ALLOW_MODIFY_CONTENTS
          The operation permitted when the document is opened with the user password.
static java.lang.String PDF_ALLOW_PRINTING
          The operation permitted when the document is opened with the user password.
static java.lang.String PDF_ALLOW_SCREEN_READERS
          The operation permitted when the document is opened with the user password.
static java.lang.String PDF_AUTHOR
          Set this property to set the pdf author metadata.
static java.lang.String PDF_CREATOR
          Set this property to set the pdf creator metadata.
static java.lang.String PDF_ENCRYPTION_PASSWORD
          Set this property with the desired password of pdf encryption.
static java.lang.String PDF_PRODUCER
          Set this property to set the pdf producer metadata.
static java.lang.String PDF_RENDERER_CLASS
          name of a custom pdf renderer class.
static java.lang.String PDF_SIGNING_KEYSTORE_PASSWORD
          set it with the password to open the keystore
static java.lang.String PDF_SIGNING_LOCATION
          set it with the location of the signing
static java.lang.String PDF_SIGNING_PRIVATE_KEY_FILE
          set it with the path to the file containing the private key
static java.lang.String PDF_SIGNING_PRIVATE_KEY_PASSWORD
          set it with the password to get the private key
static java.lang.String PDF_SIGNING_REASON
          set it with a reason for the signing
static java.lang.String PDF_TITLE
          Set this property to set the pdf title metadata.
static java.lang.String SWING_PDF_RENDERER
          Default PDF renderer class, use swing to render HTML.
static java.lang.String USE_PDF_ENCRYPTION
          Set this property to true to allow encryption of the PDF
static java.lang.String USE_PDF_SELF_SIGNING
          default to true.
static java.lang.String USE_PDF_SIGNING
          set to true to sign a document with a certificate PDF_SIGNING_PRIVATE_KEY_PASSWORD, PDF_SIGNING_KEYSTORE_PASSWORD, PDF_SIGNING_PRIVATE_KEY_FILE must be set.
static java.lang.String VERSION
          YaHP Converter version
 
Method Summary
 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
 

Field Detail

A0L

static final IHtmlToPdfTransformer.PageSize A0L
A0 landscape size


A0P

static final IHtmlToPdfTransformer.PageSize A0P
A0 portrait size


A10L

static final IHtmlToPdfTransformer.PageSize A10L
A10 landscape size


A10P

static final IHtmlToPdfTransformer.PageSize A10P
A10 portrait size


A11L

static final IHtmlToPdfTransformer.PageSize A11L
A11 landscape size


A11P

static final IHtmlToPdfTransformer.PageSize A11P
A11 portrait size


A12L

static final IHtmlToPdfTransformer.PageSize A12L
A12 landscape size


A12P

static final IHtmlToPdfTransformer.PageSize A12P
A12 portrait size


A13L

static final IHtmlToPdfTransformer.PageSize A13L
A13 landscape size


A13P

static final IHtmlToPdfTransformer.PageSize A13P
A13 portrait size


A14L

static final IHtmlToPdfTransformer.PageSize A14L
A14 landscape size


A14P

static final IHtmlToPdfTransformer.PageSize A14P
A14 portrait size


A1L

static final IHtmlToPdfTransformer.PageSize A1L
A1 landscape size


A1P

static final IHtmlToPdfTransformer.PageSize A1P
A1 portrait size


A2L

static final IHtmlToPdfTransformer.PageSize A2L
A2 landscape size


A2P

static final IHtmlToPdfTransformer.PageSize A2P
A2 portrait size


A3L

static final IHtmlToPdfTransformer.PageSize A3L
A3 landscape size


A3P

static final IHtmlToPdfTransformer.PageSize A3P
A3 portrait size


A4L

static final IHtmlToPdfTransformer.PageSize A4L
A4 landscape size


A4P

static final IHtmlToPdfTransformer.PageSize A4P
A4 portrait size


A5L

static final IHtmlToPdfTransformer.PageSize A5L
A5 landscape size


A5P

static final IHtmlToPdfTransformer.PageSize A5P
A5 portrait size


A6L

static final IHtmlToPdfTransformer.PageSize A6L
A6 landscape size


A6P

static final IHtmlToPdfTransformer.PageSize A6P
A6 portrait size


A7L

static final IHtmlToPdfTransformer.PageSize A7L
A7 landscape size


A7P

static final IHtmlToPdfTransformer.PageSize A7P
A7 portrait size


A8L

static final IHtmlToPdfTransformer.PageSize A8L
A8 landscape size


A8P

static final IHtmlToPdfTransformer.PageSize A8P
A8 portrait size


A9L

static final IHtmlToPdfTransformer.PageSize A9L
A9 landscape size


A9P

static final IHtmlToPdfTransformer.PageSize A9P
A9 portrait size


DEFAULT_PDF_RENDERER

static final java.lang.String DEFAULT_PDF_RENDERER
Default PDF renderer class, use swing to render HTML.

See Also:
Constant Field Values

FIREFOX_PDF_RENDERER

static final java.lang.String FIREFOX_PDF_RENDERER
PDF renderer class, use Mozilla Firefox to render HTML.

See Also:
Constant Field Values

FIREFOX_PRINT_SCRIPT_PATH

static final java.lang.String FIREFOX_PRINT_SCRIPT_PATH
Firefox 'fireprint' script path..

See Also:
Constant Field Values

FLYINGSAUCER_PDF_RENDERER

static final java.lang.String FLYINGSAUCER_PDF_RENDERER
PDF renderer class, use Flying Saucer Project to render HTML.

See Also:
Constant Field Values

FOP_TTF_FONT_PATH

static final java.lang.String FOP_TTF_FONT_PATH
Path to TTF font for embedding with FOP

See Also:
Constant Field Values

HANDLE_CHAR_AS_GLYPH

static final java.lang.String HANDLE_CHAR_AS_GLYPH
If you'll convert non-latin html document, you can set this property to true or embed fonts. It affects speed, but rendering will be correct. (Use it for chinese,japanese,...)

See Also:
Constant Field Values

OOO_PDF_HOST

static final java.lang.String OOO_PDF_HOST
OpenOffice listener hostname, default is localhost

See Also:
Constant Field Values

OOO_PDF_PORT

static final java.lang.String OOO_PDF_PORT
OpenOffice listener port, default is 8100

See Also:
Constant Field Values

OOO_PDF_RENDERER

static final java.lang.String OOO_PDF_RENDERER
PDF renderer class, use OpenOffice.org to render HTML.

See Also:
Constant Field Values

PDF_ALLOW_ASSEMBLY

static final java.lang.String PDF_ALLOW_ASSEMBLY
The operation permitted when the document is opened with the user password. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_ALLOW_COPY

static final java.lang.String PDF_ALLOW_COPY
The operation permitted when the document is opened with the user password. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_ALLOW_DEGRADED_PRINTING

static final java.lang.String PDF_ALLOW_DEGRADED_PRINTING
The operation permitted when the document is opened with the user password. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_ALLOW_FILLIN

static final java.lang.String PDF_ALLOW_FILLIN
The operation permitted when the document is opened with the user password. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_ALLOW_MODIFT_ANNOTATIONS

static final java.lang.String PDF_ALLOW_MODIFT_ANNOTATIONS
The operation permitted when the document is opened with the user password. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_ALLOW_MODIFY_CONTENTS

static final java.lang.String PDF_ALLOW_MODIFY_CONTENTS
The operation permitted when the document is opened with the user password. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_ALLOW_PRINTING

static final java.lang.String PDF_ALLOW_PRINTING
The operation permitted when the document is opened with the user password. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_ALLOW_SCREEN_READERS

static final java.lang.String PDF_ALLOW_SCREEN_READERS
The operation permitted when the document is opened with the user password. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_AUTHOR

static final java.lang.String PDF_AUTHOR
Set this property to set the pdf author metadata.

See Also:
Constant Field Values

PDF_CREATOR

static final java.lang.String PDF_CREATOR
Set this property to set the pdf creator metadata.

See Also:
Constant Field Values

PDF_ENCRYPTION_PASSWORD

static final java.lang.String PDF_ENCRYPTION_PASSWORD
Set this property with the desired password of pdf encryption. USE_PDF_ENCRYPTION must be set to true for this property to have an effect.

See Also:
Constant Field Values

PDF_PRODUCER

static final java.lang.String PDF_PRODUCER
Set this property to set the pdf producer metadata.

See Also:
Constant Field Values

PDF_RENDERER_CLASS

static final java.lang.String PDF_RENDERER_CLASS
name of a custom pdf renderer class.

See Also:
Constant Field Values

PDF_SIGNING_KEYSTORE_PASSWORD

static final java.lang.String PDF_SIGNING_KEYSTORE_PASSWORD
set it with the password to open the keystore

See Also:
Constant Field Values

PDF_SIGNING_LOCATION

static final java.lang.String PDF_SIGNING_LOCATION
set it with the location of the signing

See Also:
Constant Field Values

PDF_SIGNING_PRIVATE_KEY_FILE

static final java.lang.String PDF_SIGNING_PRIVATE_KEY_FILE
set it with the path to the file containing the private key

See Also:
Constant Field Values

PDF_SIGNING_PRIVATE_KEY_PASSWORD

static final java.lang.String PDF_SIGNING_PRIVATE_KEY_PASSWORD
set it with the password to get the private key

See Also:
Constant Field Values

PDF_SIGNING_REASON

static final java.lang.String PDF_SIGNING_REASON
set it with a reason for the signing

See Also:
Constant Field Values

PDF_TITLE

static final java.lang.String PDF_TITLE
Set this property to set the pdf title metadata.

See Also:
Constant Field Values

SWING_PDF_RENDERER

static final java.lang.String SWING_PDF_RENDERER
Default PDF renderer class, use swing to render HTML.

See Also:
Constant Field Values

USE_PDF_ENCRYPTION

static final java.lang.String USE_PDF_ENCRYPTION
Set this property to true to allow encryption of the PDF

See Also:
Constant Field Values

USE_PDF_SELF_SIGNING

static final java.lang.String USE_PDF_SELF_SIGNING
default to true. Use an hand made certificate. To generate one : keytool -genkey -keyalg RSA -alias myname -keypass password -keystore keystore.ks -dname "cn=Your Name, c=CC" CC == Country code

See Also:
Constant Field Values

USE_PDF_SIGNING

static final java.lang.String USE_PDF_SIGNING
set to true to sign a document with a certificate PDF_SIGNING_PRIVATE_KEY_PASSWORD, PDF_SIGNING_KEYSTORE_PASSWORD, PDF_SIGNING_PRIVATE_KEY_FILE must be set. PDF_SIGNING_REASON, PDF_SIGNING_LOCATION, USE_PDF_SELF_SIGNING may be set

See Also:
Constant Field Values

VERSION

static final java.lang.String VERSION
YaHP Converter version

See Also:
Constant Field Values
Method Detail

transform

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

Parameters:
in - html document stream
urlForBase - base url of the document
size - pdf document page size
hf - header-footer list
properties - pdf renderer properties list
out - out stream to the pdf file precondition: in != null precondition: urlForBase != null precondition: size != null precondition: != null precondition: properties != null precondition: out != null
Throws:
IHtmlToPdfTransformer.CConvertException - if a conversion exception occurs