|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.docx4j.org.xhtmlrenderer.simple.PDFRenderer
public class PDFRenderer
PDFRenderer supports headless rendering of XHTML documents, outputting to PDF format. There are two static utility methods, one for rendering a
URL, renderToPDF(String, String) and one
for rendering a File, renderToPDF(File, String)
You can use this utility from the command line by passing in the URL or file location as first parameter, and PDF path as second parameter:
java -cp %classpath% org.docx4j.org.xhtmlrenderer.simple.PDFRenderer
| Constructor Summary | |
|---|---|
PDFRenderer()
|
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
Renders a file or URL to a PDF. |
static void |
renderToPDF(File file,
String pdf)
Renders the XML file as a PDF file at the target location. |
static void |
renderToPDF(File file,
String pdf,
Character pdfVersion)
Renders the XML file as a PDF file at the target location. |
static void |
renderToPDF(String url,
String pdf)
Renders the XML file at the given URL as a PDF file at the target location. |
static void |
renderToPDF(String url,
String pdf,
Character pdfVersion)
Renders the XML file at the given URL as a PDF file at the target location. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PDFRenderer()
| Method Detail |
|---|
public static void renderToPDF(String url,
String pdf)
throws IOException,
com.lowagie.text.DocumentException
url - url for the XML file to renderpdf - path to the PDF file to create
IOException - if the URL or PDF location is
invalid
com.lowagie.text.DocumentException - if an error occurred
while building the Document.
public static void renderToPDF(String url,
String pdf,
Character pdfVersion)
throws IOException,
com.lowagie.text.DocumentException
url - url for the XML file to renderpdf - path to the PDF file to createpdfVersion - version of PDF to output; null uses default version
IOException - if the URL or PDF location is
invalid
com.lowagie.text.DocumentException - if an error occurred
while building the Document.
public static void renderToPDF(File file,
String pdf)
throws IOException,
com.lowagie.text.DocumentException
file - XML file to renderpdf - path to the PDF file to create
IOException - if the file or PDF location is
invalid
com.lowagie.text.DocumentException - if an error occurred
while building the Document.
public static void renderToPDF(File file,
String pdf,
Character pdfVersion)
throws IOException,
com.lowagie.text.DocumentException
file - XML file to renderpdf - path to the PDF file to createpdfVersion - version of PDF to output; null uses default version
IOException - if the file or PDF location is
invalid
com.lowagie.text.DocumentException - if an error occurred
while building the Document.
public static void main(String[] args)
throws IOException,
com.lowagie.text.DocumentException
args - see desc
IOException - if source could not be read, or if
PDF path is invalid
com.lowagie.text.DocumentException - if an error occurs while building
the document
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||