Class PdfGenerator

java.lang.Object
org.dspace.disseminate.PdfGenerator

public class PdfGenerator extends Object
Generates a PDF coverpage. The generation is a two step process: Step 1 is to generate a HTML layout using a thymeleaf template. Step 2 is to render the HTML to PDF.
  • Constructor Details

    • PdfGenerator

      public PdfGenerator()
  • Method Details

    • parseTemplate

      public String parseTemplate(String templateName, Map<String,String> variables)
      Render a HTML coverpage.
      Parameters:
      templateName - the name of the thymeleaf template
      variables - dynamic content for the template
      Returns:
      a rendered HTML coverpage
    • generateToFile

      public void generateToFile(String html, File toFile)
      render a HTML coverpage to a file
      Parameters:
      html - the coverpage HTML
      toFile - file to write to
    • generate

      public org.apache.pdfbox.pdmodel.PDDocument generate(String html)
      render a HTML coverpage to a PDDocument (pdfbox)
      Parameters:
      html - the coverpage HTML
      Returns:
      resulting pdfbox PDDocument