Class HtmlContentTransformer
java.lang.Object
org.eclipse.epsilon.picto.transformers.HtmlContentTransformer
- All Implemented Interfaces:
ViewContentTransformer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleancanTransform(ViewContent content) protected ElementgetElementByName(Element parent, String name) protected NodeListgetElements(Document document, String xpath) getLabel(ViewContent content) protected static ExternalContentTransformationinvokePandoc(Path document, String outputExt, Object... additionalArgs) Converts the HTML to the desired format using Pandoc.static PathConverts the HTML to the desired format using Pandoc.static PathConverts the HTML to the desired format using Pandoc.static StringConverts the HTML to the desired format using Pandoc.transform(ViewContent content, PictoView pictoView) static Pathwkhtmltopdf(String html) Converts HTML to PDF using wkhtmltopdf.static Pathwkhtmltopdf(Path document) Converts HTML to PDF using wkhtmltopdf.
-
Field Details
-
htmlElementTransformers
-
xmlHelper
-
-
Constructor Details
-
HtmlContentTransformer
public HtmlContentTransformer()
-
-
Method Details
-
canTransform
- Specified by:
canTransformin interfaceViewContentTransformer
-
getLabel
- Specified by:
getLabelin interfaceViewContentTransformer
-
transform
- Specified by:
transformin 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.
-