class PDF extends RenderResultProcessor[FOWriter]
A post processor for PDF output, based on an interim XSL-FO renderer.
May be directly passed to the Render or Transform APIs:
val document: Document = ... Render as PDF from document toFile "hello.pdf" Transform from Markdown to PDF fromDirectory "book-src" toFile "book.pdf"
In the second example above the input from an entire directory gets merged into a single output directory.
- Alphabetic
- By Inheritance
- RenderResultProcessor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
factory: XSLFO
- Definition Classes
- PDF → RenderResultProcessor
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
process(tree: DocumentTree, render: (DocumentTree, OutputConfig) ⇒ Unit, output: BinaryOutput): Unit
Processes the tree by first using the specified render function to produce the interim XSL-FO result, transform the result to PDF and write it to the specified final output.
Processes the tree by first using the specified render function to produce the interim XSL-FO result, transform the result to PDF and write it to the specified final output.
- tree
the tree to render to the interim result
- render
the render function for producing the interim XSL-FO result
- output
the output to write the final result to
- Definition Classes
- PDF → RenderResultProcessor
-
def
renderFO(tree: DocumentTree, render: (DocumentTree, OutputConfig) ⇒ Unit): String
Renders the XSL-FO that serves as a basis for producing the final PDF output.
Renders the XSL-FO that serves as a basis for producing the final PDF output. The result should include the output from rendering the documents in the specified tree as well as any additional insertions like bookmarks or table of content. For this the specified
DocumentTreeinstance may get modified before passing it to the given render function.The default implementation simply delegates to an instance of
FOforPDFwhich uses aPDFConfigobject to drive configuration. In rare cases where the flexibility provided byPDFConfigis not sufficient, this method may get overridden.- tree
the document tree serving as input for the renderer
- render
the actual render function for producing the XSL-FO output
- returns
the rendered XSL-FO as a String
- Attributes
- protected
-
def
renderPDF(foInput: Input, output: BinaryOutput, sourcePaths: Seq[String] = Nil): Unit
Render the given XSL-FO input as a PDF to the specified binary output.
Render the given XSL-FO input as a PDF to the specified binary output. The optional
sourcePathsargument may be used to allow resolving relative paths for loading external files like images.- foInput
the input in XSL-FO format
- output
the output to write the final result to
- sourcePaths
the paths that may contain files like images which will be used to resolve relative paths
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withConfig(config: PDFConfig): PDF
Allows to specify configuration options like insertion of bookmarks or table of content.
-
def
withFopFactory(fopFactory: FopFactory): PDF
Allows to specify a custom FopFactory in case additional configuration is required for custom fonts, stemmers or other FOP features.
Allows to specify a custom FopFactory in case additional configuration is required for custom fonts, stemmers or other FOP features.
A
FopFactoryis a fairly heavy-weight object, so make sure that you reuse either theFopFactoryinstance itself or the resultingPDFrenderer. In case you do not specify a custom factory, Laika ensures that the default factory is reused between renderers. -
def
withMessageLevel(level: MessageLevel): PDF
Specifies the minimum required level for a system message to get included into the output by this renderer.