Interface PdfTemplate


  • public interface PdfTemplate
    Renders an HTML using Thymeleaf. Then transforms it into XHTML using JSoup. Finally, transform the XHTML in PDF using Flying Saucer. All HTML templates are in src/main/resources/pdf-templates. The template called 'layout' is always used to generate the general page structure: styles, header, footer, etc. The actual content page to be rendered is included in the layout template in the content section.
    • Method Detail

      • landscape

        PdfTemplate landscape​(boolean landscape)
        Sets the template to be rendered in landscape orientation (if true) or portrait (default, if false)
      • noFooter

        PdfTemplate noFooter()
        Suppresses the default PDF footer
      • noHeader

        PdfTemplate noHeader()
        Suppresses the default PDF header. As the header contains the title, suppressing the header will make it useless to set a title.
      • streamFactory

        PdfTemplate streamFactory​(StreamFactory factory)
        Registers a StreamFactory, that is, a handler for a custom URL protocol in the HTML template
      • title

        PdfTemplate title​(MessageKey key,
                          Object... args)
        Sets the PDF title from a translation key. Only used if the header is not suppressed.
      • title

        PdfTemplate title​(String title)
        Sets the PDF title. Only used if the header is not suppressed.