public class PDFRenderer
extends java.lang.Object
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.xhtmlrenderer.simple.PDFRenderer
Constructor and Description |
---|
PDFRenderer() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Renders a file or URL to a PDF.
|
static void |
renderToPDF(java.io.File file,
java.lang.String pdf)
Renders the XML file as a PDF file at the target location.
|
static void |
renderToPDF(java.io.File file,
java.lang.String pdf,
java.lang.Character pdfVersion)
Renders the XML file as a PDF file at the target location.
|
static void |
renderToPDF(java.lang.String url,
java.lang.String pdf)
Renders the XML file at the given URL as a PDF file
at the target location.
|
static void |
renderToPDF(java.lang.String url,
java.lang.String pdf,
java.lang.Character pdfVersion)
Renders the XML file at the given URL as a PDF file
at the target location.
|
public static void renderToPDF(java.lang.String url, java.lang.String pdf) throws java.io.IOException, com.lowagie.text.DocumentException
url
- url for the XML file to renderpdf
- path to the PDF file to createjava.io.IOException
- if the URL or PDF location is
invalidcom.lowagie.text.DocumentException
- if an error occurred
while building the Document.public static void renderToPDF(java.lang.String url, java.lang.String pdf, java.lang.Character pdfVersion) throws java.io.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 versionjava.io.IOException
- if the URL or PDF location is
invalidcom.lowagie.text.DocumentException
- if an error occurred
while building the Document.public static void renderToPDF(java.io.File file, java.lang.String pdf) throws java.io.IOException, com.lowagie.text.DocumentException
file
- XML file to renderpdf
- path to the PDF file to createjava.io.IOException
- if the file or PDF location is
invalidcom.lowagie.text.DocumentException
- if an error occurred
while building the Document.public static void renderToPDF(java.io.File file, java.lang.String pdf, java.lang.Character pdfVersion) throws java.io.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 versionjava.io.IOException
- if the file or PDF location is
invalidcom.lowagie.text.DocumentException
- if an error occurred
while building the Document.public static void main(java.lang.String[] args) throws java.io.IOException, com.lowagie.text.DocumentException
args
- see descjava.io.IOException
- if source could not be read, or if
PDF path is invalidcom.lowagie.text.DocumentException
- if an error occurs while building
the document