Class HtmlContentTransformer
java.lang.Object
org.eclipse.epsilon.picto.transformers.HtmlContentTransformer
- All Implemented Interfaces:
ViewContentTransformer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
boolean
canTransform
(ViewContent content) protected Element
getElementByName
(Element parent, String name) protected NodeList
getElements
(Document document, String xpath) getLabel
(ViewContent content) protected static ExternalContentTransformation
invokePandoc
(Path document, String outputExt, Object... additionalArgs) Converts the HTML to the desired format using Pandoc.static Path
Converts the HTML to the desired format using Pandoc.static Path
Converts the HTML to the desired format using Pandoc.static String
Converts the HTML to the desired format using Pandoc.transform
(ViewContent content, PictoView pictoView) static Path
wkhtmltopdf
(String html) Converts HTML to PDF using wkhtmltopdf.static Path
wkhtmltopdf
(Path document) Converts HTML to PDF using wkhtmltopdf.
-
Field Details
-
htmlElementTransformers
-
xmlHelper
-
-
Constructor Details
-
HtmlContentTransformer
public HtmlContentTransformer()
-
-
Method Details
-
canTransform
- Specified by:
canTransform
in interfaceViewContentTransformer
-
getLabel
- Specified by:
getLabel
in interfaceViewContentTransformer
-
transform
- Specified by:
transform
in interfaceViewContentTransformer
- Throws:
Exception
-
addZoom
-
getElementByName
-
getElements
- Throws:
Exception
-
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
Converts HTML to PDF using wkhtmltopdf.- Parameters:
html
- The raw HTML text.- Returns:
- The output PDF file.
- Throws:
IOException
- If invoking wkhtmltopdf fails.
-
wkhtmltopdf
Converts HTML to PDF using wkhtmltopdf.- Parameters:
html
- The HTML file.- Returns:
- The output PDF file.
- Throws:
IOException
- If invoking wkhtmltopdf fails.
-