public class HtmlConverter extends Object
String,
File, or InputStream, and convert it to PDF in the
form of an OutputStream, File, or a series of
iText elements. It's also possible to write to a PdfWriter or
PdfDocument instance.| Modifier and Type | Method and Description |
|---|---|
static com.itextpdf.layout.Document |
convertToDocument(InputStream htmlStream,
com.itextpdf.kernel.pdf.PdfDocument pdfDocument,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to objects that
will be added to a PdfDocument, using specific ConverterProperties,
returning a Document instance. |
static com.itextpdf.layout.Document |
convertToDocument(InputStream htmlStream,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter)
Converts HTML obtained from an
InputStream to content that
will be written to a PdfWriter, returning a Document instance. |
static com.itextpdf.layout.Document |
convertToDocument(InputStream htmlStream,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to content that
will be written to a PdfWriter, using specific
ConverterProperties, returning a Document instance. |
static com.itextpdf.layout.Document |
convertToDocument(String html,
com.itextpdf.kernel.pdf.PdfDocument pdfDocument,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to objects that
will be added to a PdfDocument, using specific ConverterProperties,
returning a Document instance. |
static com.itextpdf.layout.Document |
convertToDocument(String html,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter)
Converts HTML obtained from an
InputStream to content that
will be written to a PdfWriter, returning a Document instance. |
static com.itextpdf.layout.Document |
convertToDocument(String html,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to content that
will be written to a PdfWriter, using specific
ConverterProperties, returning a Document instance. |
static List<com.itextpdf.layout.element.IElement> |
convertToElements(InputStream htmlStream)
|
static List<com.itextpdf.layout.element.IElement> |
convertToElements(InputStream htmlStream,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to a List of
iText objects (IElement instances), using specific
ConverterProperties. |
static List<com.itextpdf.layout.element.IElement> |
convertToElements(String html)
|
static List<com.itextpdf.layout.element.IElement> |
convertToElements(String html,
ConverterProperties converterProperties)
Converts a
String containing HTML to a List of
iText objects (IElement instances), using specific
ConverterProperties. |
static void |
convertToPdf(File htmlFile,
File pdfFile)
|
static void |
convertToPdf(File htmlFile,
File pdfFile,
ConverterProperties converterProperties)
|
static void |
convertToPdf(InputStream htmlStream,
OutputStream pdfStream)
Converts HTML obtained from an
InputStream to a PDF written to
an OutputStream. |
static void |
convertToPdf(InputStream htmlStream,
OutputStream pdfStream,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to a PDF written to
an OutputStream. |
static void |
convertToPdf(InputStream htmlStream,
com.itextpdf.kernel.pdf.PdfDocument pdfDocument)
Converts HTML obtained from an
InputStream to objects that
will be added to a PdfDocument. |
static void |
convertToPdf(InputStream htmlStream,
com.itextpdf.kernel.pdf.PdfDocument pdfDocument,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to objects that
will be added to a PdfDocument, using specific ConverterProperties. |
static void |
convertToPdf(InputStream htmlStream,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter)
Converts HTML obtained from an
InputStream to content that
will be written to a PdfWriter. |
static void |
convertToPdf(InputStream htmlStream,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to content that
will be written to a PdfWriter, using specific
ConverterProperties. |
static void |
convertToPdf(String html,
OutputStream pdfStream)
Converts a
String containing HTML to an OutputStream
containing PDF. |
static void |
convertToPdf(String html,
OutputStream pdfStream,
ConverterProperties converterProperties)
Converts a
String containing HTML to an OutputStream
containing PDF, using specific ConverterProperties. |
static void |
convertToPdf(String html,
com.itextpdf.kernel.pdf.PdfDocument pdfDocument,
ConverterProperties converterProperties)
Converts HTML obtained from an
InputStream to objects that
will be added to a PdfDocument, using specific ConverterProperties. |
static void |
convertToPdf(String html,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter)
Converts a
String containing HTML to PDF by writing PDF content
to a PdfWriter instance. |
static void |
convertToPdf(String html,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
ConverterProperties converterProperties)
Converts a
String containing HTML to PDF by writing PDF content
to a PdfWriter instance, using specific ConverterProperties. |
public static void convertToPdf(String html, OutputStream pdfStream) throws IOException
String containing HTML to an OutputStream
containing PDF.html - the html in the form of a StringpdfStream - the PDF as an OutputStreamIOException - Signals that an I/O exception has occurred.public static void convertToPdf(String html, OutputStream pdfStream, ConverterProperties converterProperties) throws IOException
String containing HTML to an OutputStream
containing PDF, using specific ConverterProperties.html - the html in the form of a StringpdfStream - the PDF as an OutputStreamconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.public static void convertToPdf(String html, com.itextpdf.kernel.pdf.PdfWriter pdfWriter) throws IOException
String containing HTML to PDF by writing PDF content
to a PdfWriter instance.html - the html in the form of a StringpdfWriter - the PdfWriter instanceIOException - Signals that an I/O exception has occurred.public static void convertToPdf(String html, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, ConverterProperties converterProperties) throws IOException
String containing HTML to PDF by writing PDF content
to a PdfWriter instance, using specific ConverterProperties.html - the html in the form of a StringpdfWriter - the PdfWriter instanceconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.public static void convertToPdf(String html, com.itextpdf.kernel.pdf.PdfDocument pdfDocument, ConverterProperties converterProperties) throws IOException
InputStream to objects that
will be added to a PdfDocument, using specific ConverterProperties.html - the html in the form of a StringpdfDocument - the PdfDocument instanceconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.public static void convertToPdf(File htmlFile, File pdfFile) throws IOException
htmlFile - the File containing the source HTMLpdfFile - the File containing the resulting PDFIOException - Signals that an I/O exception has occurred.public static void convertToPdf(File htmlFile, File pdfFile, ConverterProperties converterProperties) throws IOException
htmlFile - the File containing the source HTMLpdfFile - the File containing the resulting PDFconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.public static void convertToPdf(InputStream htmlStream, OutputStream pdfStream) throws IOException
InputStream to a PDF written to
an OutputStream.htmlStream - the InputStream with the source HTMLpdfStream - the OutputStream for the resulting PDFIOException - Signals that an I/O exception has occurred.public static void convertToPdf(InputStream htmlStream, OutputStream pdfStream, ConverterProperties converterProperties) throws IOException
InputStream to a PDF written to
an OutputStream.htmlStream - the InputStream with the source HTMLpdfStream - the OutputStream for the resulting PDFconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.public static void convertToPdf(InputStream htmlStream, com.itextpdf.kernel.pdf.PdfDocument pdfDocument) throws IOException
InputStream to objects that
will be added to a PdfDocument.htmlStream - the InputStream with the source HTMLpdfDocument - the PdfDocument instanceIOException - Signals that an I/O exception has occurred.public static void convertToPdf(InputStream htmlStream, com.itextpdf.kernel.pdf.PdfWriter pdfWriter) throws IOException
InputStream to content that
will be written to a PdfWriter.htmlStream - the InputStream with the source HTMLpdfWriter - the PdfWriter containing the resulting PDFIOException - Signals that an I/O exception has occurred.public static void convertToPdf(InputStream htmlStream, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, ConverterProperties converterProperties) throws IOException
InputStream to content that
will be written to a PdfWriter, using specific
ConverterProperties.htmlStream - the InputStream with the source HTMLpdfWriter - the PdfWriter containing the resulting PDFconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.public static void convertToPdf(InputStream htmlStream, com.itextpdf.kernel.pdf.PdfDocument pdfDocument, ConverterProperties converterProperties) throws IOException
InputStream to objects that
will be added to a PdfDocument, using specific ConverterProperties.htmlStream - the InputStream with the source HTMLpdfDocument - the PdfDocument instanceconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.public static com.itextpdf.layout.Document convertToDocument(String html, com.itextpdf.kernel.pdf.PdfWriter pdfWriter) throws IOException
InputStream to content that
will be written to a PdfWriter, returning a Document instance.html - the html in the form of a StringpdfWriter - the PdfWriter containing the resulting PDFDocument instanceIOException - Signals that an I/O exception has occurred.public static com.itextpdf.layout.Document convertToDocument(InputStream htmlStream, com.itextpdf.kernel.pdf.PdfWriter pdfWriter) throws IOException
InputStream to content that
will be written to a PdfWriter, returning a Document instance.htmlStream - the InputStream with the source HTMLpdfWriter - the PdfWriter containing the resulting PDFDocument instanceIOException - Signals that an I/O exception has occurred.public static com.itextpdf.layout.Document convertToDocument(String html, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, ConverterProperties converterProperties) throws IOException
InputStream to content that
will be written to a PdfWriter, using specific
ConverterProperties, returning a Document instance.html - the html in the form of a StringpdfWriter - the pdf writerconverterProperties - a ConverterProperties instanceDocument instanceIOException - Signals that an I/O exception has occurred.public static com.itextpdf.layout.Document convertToDocument(InputStream htmlStream, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, ConverterProperties converterProperties) throws IOException
InputStream to content that
will be written to a PdfWriter, using specific
ConverterProperties, returning a Document instance.htmlStream - the html streampdfWriter - the pdf writerconverterProperties - a ConverterProperties instanceDocument instanceIOException - Signals that an I/O exception has occurred.public static com.itextpdf.layout.Document convertToDocument(String html, com.itextpdf.kernel.pdf.PdfDocument pdfDocument, ConverterProperties converterProperties) throws IOException
InputStream to objects that
will be added to a PdfDocument, using specific ConverterProperties,
returning a Document instance.html - the html in the form of a StringpdfDocument - the PdfDocument instanceconverterProperties - a ConverterProperties instanceDocument instanceIOException - Signals that an I/O exception has occurred.public static com.itextpdf.layout.Document convertToDocument(InputStream htmlStream, com.itextpdf.kernel.pdf.PdfDocument pdfDocument, ConverterProperties converterProperties) throws IOException
InputStream to objects that
will be added to a PdfDocument, using specific ConverterProperties,
returning a Document instance.htmlStream - the InputStream with the source HTMLpdfDocument - the PdfDocument instanceconverterProperties - a ConverterProperties instanceDocument instanceIOException - Signals that an I/O exception has occurred.public static List<com.itextpdf.layout.element.IElement> convertToElements(String html) throws IOException
html - the html in the form of a StringIOException - Signals that an I/O exception has occurred.public static List<com.itextpdf.layout.element.IElement> convertToElements(InputStream htmlStream) throws IOException
htmlStream - the InputStream with the source HTMLIOException - Signals that an I/O exception has occurred.public static List<com.itextpdf.layout.element.IElement> convertToElements(String html, ConverterProperties converterProperties) throws IOException
String containing HTML to a List of
iText objects (IElement instances), using specific
ConverterProperties.html - the html in the form of a StringconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.public static List<com.itextpdf.layout.element.IElement> convertToElements(InputStream htmlStream, ConverterProperties converterProperties) throws IOException
InputStream to a List of
iText objects (IElement instances), using specific
ConverterProperties.htmlStream - the InputStream with the source HTMLconverterProperties - a ConverterProperties instanceIOException - Signals that an I/O exception has occurred.Copyright © 1998–2019 iText Group NV. All rights reserved.