Class HtmlContentTransformer

    • Constructor Detail

      • HtmlContentTransformer

        public HtmlContentTransformer()
    • Method Detail

      • addZoom

        protected void addZoom​(Document document)
      • pandocRaw

        public static String pandocRaw​(String html,
                                       String outputExt,
                                       Object... additionalArgs)
                                throws IOException
        Converts the HTML to the desired format using Pandoc.
        Parameters:
        html - The raw HTML text.
        outputExt - The output file format.
        additionalArgs - Other arguments to pass to Pandoc.
        Returns:
        The raw output of the file as a String.
        Throws:
        IOException - If invoking Pandoc fails.
      • pandoc

        public static Path pandoc​(String html,
                                  String outputExt,
                                  Object... additionalArgs)
                           throws IOException
        Converts the HTML to the desired format using Pandoc.
        Parameters:
        html - The raw HTML text.
        outputExt - The output file format.
        additionalArgs - Other arguments to pass to Pandoc.
        Returns:
        The output file.
        Throws:
        IOException - If invoking Pandoc fails.
      • pandoc

        public static Path pandoc​(Path document,
                                  String outputExt,
                                  Object... additionalArgs)
                           throws IOException
        Converts the HTML to the desired format using Pandoc.
        Parameters:
        document - The HTML file.
        outputExt - The output file format.
        additionalArgs - Other arguments to pass to Pandoc.
        Returns:
        The output file.
        Throws:
        IOException - If invoking Pandoc fails.
      • invokePandoc

        protected static ExternalContentTransformation invokePandoc​(Path document,
                                                                    String outputExt,
                                                                    Object... additionalArgs)
                                                             throws IOException
        Converts the HTML to the desired format using Pandoc.
        Parameters:
        html - The HTML file.
        outputExt - The output file format.
        additionalArgs - Other arguments to pass to Pandoc.
        Returns:
        The transformation, prior to running it.
        Throws:
        IOException - If invoking Pandoc fails.
      • wkhtmltopdf

        public static Path wkhtmltopdf​(String html)
                                throws IOException
        Converts HTML to PDF using wkhtmltopdf.
        Parameters:
        html - The raw HTML text.
        Returns:
        The output PDF file.
        Throws:
        IOException - If invoking wkhtmltopdf fails.
      • wkhtmltopdf

        public static Path wkhtmltopdf​(Path document)
                                throws IOException
        Converts HTML to PDF using wkhtmltopdf.
        Parameters:
        html - The HTML file.
        Returns:
        The output PDF file.
        Throws:
        IOException - If invoking wkhtmltopdf fails.