Interface PdfRenderer

All Known Implementing Classes:
OpenPdfRenderer

@API(status=STABLE, since="1.0", consumers="OpenPdfRenderer") @Component public interface PdfRenderer
Basic PDF functionality to generate from an application letters or reports.
Since:
1.0
Version:
1.2
Author:
elmar.dott@gmail.com
  • Field Details

    • FEATURE_ID

      @API(status=STABLE, since="2.0") static final String FEATURE_ID
      Identifier for the given feature.
      See Also:
  • Method Details

    • writeDocument

      @API(status=STABLE, since="3.0") void writeDocument(PdfDocument pdf, String destination) throws IOException, FileNotFoundException
      Writes a PDF document (PdfReader) to the given destination.
      Parameters:
      pdf - as PdfReader
      destination - as String
      Throws:
      IOException
      FileNotFoundException
    • loadDocument

      @API(status=STABLE, since="3.0") PdfDocument loadDocument(File pdfDocument) throws IOException
      Read a PDF from FILE as PdfReader.
      Parameters:
      pdfDocument - as File
      Returns:
      pdf as PdfReader
      Throws:
      IOException
    • removePage

      @API(status=STABLE, since="3.0") PdfDocument removePage(PdfDocument pdf, int... pages) throws IOException
      Remove from a given PDF pages. Usage:
      PdfReader pdf = readDocument(new File(document.pdf)); File newPdf = removePages(pdf, 2, 4, 12);
      Removes from the PDF document the pages: 2,4 and 12.
      Parameters:
      pdf - as PdfReader
      pages - as int
      Returns:
      pdf as PdfReader
      Throws:
      IOException
    • renderDocumentFromHtml

      @API(status=STABLE, since="3.0") void renderDocumentFromHtml(String file, String htmlTemplate) throws FileNotFoundException
      Generate a PDF document in the size A4 from a HTML String. The file parameter define the path were the PDF will sored an how the document is named.
      Parameters:
      file - as String
      htmlTemplate - as String
      Throws:
      FileNotFoundException
    • setAuthor

      @API(status=STABLE, since="1.0") void setAuthor(String author)
      Set the author for the document.
      Parameters:
      author - as String
    • setKeywords

      @API(status=STABLE, since="1.0") void setKeywords(String keywords)
      Set hte keywords for the document.
      Parameters:
      keywords - as String
    • setSubject

      @API(status=STABLE, since="1.0") void setSubject(String subject)
      Set the document subject.
      Parameters:
      subject - as String
    • setTitle

      @API(status=STABLE, since="1.0") void setTitle(String title)
      Set the document title.
      Parameters:
      title - as String
    • getAuthor

      @API(status=STABLE, since="1.0") String getAuthor()
      Get the author of the document.
      Returns:
      author as String
    • getKeywords

      @API(status=STABLE, since="1.0") String getKeywords()
      Get the document related keywords.
      Returns:
      keywords as String
    • getSubject

      @API(status=STABLE, since="1.0") String getSubject()
      Get the document subject.
      Returns:
      subject as String
    • getTitle

      @API(status=STABLE, since="1.0") String getTitle()
      Get the document title.
      Returns:
      title as String