public abstract class BaseRendererBuilder<TFinalClass extends BaseRendererBuilder,TBaseRendererBuilderState extends BaseRendererBuilder.BaseRendererBuilderState> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseRendererBuilder.BaseRendererBuilderState
This class is an internal implementation detail
|
static class |
BaseRendererBuilder.FontStyle |
static class |
BaseRendererBuilder.PageSizeUnits |
static class |
BaseRendererBuilder.TextDirection |
| Modifier and Type | Field and Description |
|---|---|
static float |
PAGE_SIZE_LETTER_HEIGHT |
static BaseRendererBuilder.PageSizeUnits |
PAGE_SIZE_LETTER_UNITS |
static float |
PAGE_SIZE_LETTER_WIDTH |
protected TBaseRendererBuilderState |
state |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseRendererBuilder(TBaseRendererBuilderState state) |
| Modifier and Type | Method and Description |
|---|---|
TFinalClass |
addDOMMutator(FSDOMMutator domMutator)
Add a DOM mutator to this builder.
|
TFinalClass |
defaultTextDirection(BaseRendererBuilder.TextDirection textDirection)
The default text direction of the document.
|
TFinalClass |
testMode(boolean mode)
Whether to use test mode and output the PDF uncompressed.
|
TFinalClass |
useCache(FSCache cache)
Provides an external cache which can choose to cache items between runs, such
as fonts or logo images.
|
TFinalClass |
useDefaultPageSize(float pageWidth,
float pageHeight,
BaseRendererBuilder.PageSizeUnits units)
Specifies the default page size to use if none is specified in CSS.
|
TFinalClass |
useDocumentBuilderFactoryImplementationClass(String documentBuilderFactoryClass)
This method should be considered advanced and is not required for most
setups.
|
TFinalClass |
useFastMode()
Use the new (May 2018) fast renderer if possible (only PDF at this point).
|
TFinalClass |
useHttpStreamImplementation(FSStreamFactory factory)
Provides an HttpStreamFactory implementation if the user desires to use an
external HTTP/HTTPS implementation.
|
TFinalClass |
useMathMLDrawer(SVGDrawer mathMlImpl)
Use the specified MathML implementation.
|
TFinalClass |
useMultiThreadByteCache(FSMultiThreadCache<byte[]> byteCache)
Provides a cache implementation that may be used accross threads.
|
TFinalClass |
useMultiThreadStringCache(FSMultiThreadCache<String> textCache)
Provides a cache implementation that may be used accross threads.
|
TFinalClass |
useObjectDrawerFactory(FSObjectDrawerFactory objectDrawerFactory)
Set a factory for <object> drawers
|
TFinalClass |
useProtocolsStreamImplementation(FSStreamFactory factory,
Set<String> protocols)
Provides an
FSStreamFactory
implementation if the user desires to use an external
stream provider for a particular set of protocols. |
TFinalClass |
useProtocolsStreamImplementation(FSStreamFactory factory,
String... protocols)
Provides an
FSStreamFactory
implementation if the user desires to use an external
stream provider for a particular list of protocols. |
TFinalClass |
useReplacementText(String replacement)
The replacement text to use if a character is cannot be renderered by any of
the specified fonts.
|
TFinalClass |
useSVGDrawer(SVGDrawer svgImpl)
Uses the specified SVG drawer implementation.
|
TFinalClass |
useTransformerFactoryImplementationClass(String transformerFactoryClass)
This method should be considered advanced and is not required for most
setups.
|
TFinalClass |
useUnicodeBidiReorderer(BidiReorderer reorderer)
Provides a reorderer to properly reverse RTL text.
|
TFinalClass |
useUnicodeBidiSplitter(BidiSplitterFactory splitter)
Provides a text splitter to split text into directional runs.
|
TFinalClass |
useUnicodeCharacterBreaker(FSTextBreaker breaker)
Specify the character breaker.
|
TFinalClass |
useUnicodeLineBreaker(FSTextBreaker breaker)
Specify the line breaker.
|
TFinalClass |
useUnicodeToLowerTransformer(FSTextTransformer tr)
Specify a transformer to use to lower case strings.
|
TFinalClass |
useUnicodeToTitleTransformer(FSTextTransformer tr)
Specify a transformer to title case strings.
|
TFinalClass |
useUnicodeToUpperTransformer(FSTextTransformer tr)
Specify a transformer to use to upper case strings.
|
TFinalClass |
useUriResolver(FSUriResolver resolver)
Provides a uri resolver to resolve relative uris or private uri schemes.
|
TFinalClass |
withFile(File file)
Provides a file to convert to PDF.
|
TFinalClass |
withHtmlContent(String html,
String baseUri)
Provides a string containing XHTML/XML to convert to PDF.
|
TFinalClass |
withUri(String uri)
Provides a URI to convert to PDF.
|
TFinalClass |
withW3cDocument(Document doc,
String baseUri)
Provides a w3c DOM Document acquired from an external source.
|
public static final float PAGE_SIZE_LETTER_WIDTH
public static final float PAGE_SIZE_LETTER_HEIGHT
public static final BaseRendererBuilder.PageSizeUnits PAGE_SIZE_LETTER_UNITS
protected final TBaseRendererBuilderState extends BaseRendererBuilder.BaseRendererBuilderState state
protected BaseRendererBuilder(TBaseRendererBuilderState state)
public TFinalClass addDOMMutator(FSDOMMutator domMutator)
domMutator - the DOM Mutatorpublic final TFinalClass useTransformerFactoryImplementationClass(String transformerFactoryClass)
transformerFactoryClass - public final TFinalClass useDocumentBuilderFactoryImplementationClass(String documentBuilderFactoryClass)
documentBuilderFactoryClass - public final TFinalClass defaultTextDirection(BaseRendererBuilder.TextDirection textDirection)
textDirection - public final TFinalClass testMode(boolean mode)
mode - public final TFinalClass useHttpStreamImplementation(FSStreamFactory factory)
factory - {@link #useProtocolsStreamImplementation(FSStreamFactory, String[])}public final TFinalClass useProtocolsStreamImplementation(FSStreamFactory factory, Set<String> protocols)
FSStreamFactory
implementation if the user desires to use an external
stream provider for a particular set of protocols.
Protocols should always be in lower case.
NOTE: HttpStreamFactory, despite its historical name, can be used for any protocol
including private made-up protocols.factory - protocols - #useHttpStreamImplementation(FSStreamFactory)},
#useProtocolsStreamImplementation(FSStreamFactory, String[])}public final TFinalClass useProtocolsStreamImplementation(FSStreamFactory factory, String... protocols)
FSStreamFactory
implementation if the user desires to use an external
stream provider for a particular list of protocols.
Protocols should always be in lower case.
NOTE: HttpStreamFactory, despite its historical name, can be used for any protocol
including private made-up protocols.factory - protocols - #useHttpStreamImplementation(FSStreamFactory)},
#useProtocolsStreamImplementation(FSStreamFactory, Set)}public final TFinalClass useUriResolver(FSUriResolver resolver)
resolver - public final TFinalClass useMultiThreadStringCache(FSMultiThreadCache<String> textCache)
useMultiThreadByteCache
The String cache is used in preference of the byte cache for
resources that are needed as text, althrough the byte cache will
also be checked before loading the resource. In this case the byte array
will be interpreted as UTF-8.#useMultiThreadByteCache(FSMultiThreadCache)},
com.openhtmltopdf.extend.FSMultiThreadCache}public final TFinalClass useMultiThreadByteCache(FSMultiThreadCache<byte[]> byteCache)
useMultiThreadStringCache#useMultiThreadStringCache(FSMultiThreadCache)},
com.openhtmltopdf.extend.FSMultiThreadCache}public final TFinalClass useCache(FSCache cache)
cache - public final TFinalClass useUnicodeBidiSplitter(BidiSplitterFactory splitter)
splitter - public final TFinalClass useUnicodeBidiReorderer(BidiReorderer reorderer)
reorderer - public final TFinalClass withHtmlContent(String html, String baseUri)
html - baseUri - public final TFinalClass withW3cDocument(Document doc, String baseUri)
doc - baseUri - public final TFinalClass withUri(String uri)
uri - public final TFinalClass withFile(File file)
file - public final TFinalClass useSVGDrawer(SVGDrawer svgImpl)
svgImpl - the SVG implementationpublic final TFinalClass useMathMLDrawer(SVGDrawer mathMlImpl)
mathMlImpl - the MathML implementationpublic final TFinalClass useReplacementText(String replacement)
replacement - the default replacement textpublic final TFinalClass useUnicodeLineBreaker(FSTextBreaker breaker)
breaker - public final TFinalClass useUnicodeCharacterBreaker(FSTextBreaker breaker)
word-wrap: break-word is in effect.breaker - public final TFinalClass useUnicodeToUpperTransformer(FSTextTransformer tr)
String::toUpperCase(Locale.US) is used.tr - public final TFinalClass useUnicodeToLowerTransformer(FSTextTransformer tr)
String::toLowerCase(Locale.US) is used.tr - public final TFinalClass useUnicodeToTitleTransformer(FSTextTransformer tr)
tr - public final TFinalClass useDefaultPageSize(float pageWidth, float pageHeight, BaseRendererBuilder.PageSizeUnits units)
pageWidth - pageHeight - units - either mm or inches.#PAGE_SIZE_LETTER_WIDTH}, {@link #PAGE_SIZE_LETTER_HEIGHT} and
{@link #PAGE_SIZE_LETTER_UNITS}public final TFinalClass useObjectDrawerFactory(FSObjectDrawerFactory objectDrawerFactory)
objectDrawerFactory - Object Drawer Factorypublic final TFinalClass useFastMode()
Copyright © 2018. All rights reserved.