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 |
convertToElements(InputStream htmlStream)
|
static List |
convertToElements(InputStream htmlStream, ConverterProperties converterProperties)
Converts HTML obtained from an InputStream to a List of iText objects (IElement instances), using specific ConverterProperties .
|
static List |
convertToElements(String html)
|
static List |
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 String
pdfStream
- the PDF as an OutputStream
IOException
- 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 String
pdfStream
- the PDF as an OutputStream
converterProperties
- a ConverterProperties
instance
IOException
- 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 String
pdfWriter
- the PdfWriter
instance
IOException
- 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 String
pdfWriter
- the PdfWriter
instance
converterProperties
- a ConverterProperties
instance
IOException
- 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 String
pdfDocument
- the PdfDocument
instance
converterProperties
- a ConverterProperties
instance
IOException
- Signals that an I/O exception has occurred.
public static void convertToPdf(File htmlFile, File pdfFile) throws IOException
htmlFile
- the File
containing the source HTML
pdfFile
- the File
containing the resulting PDF
IOException
- 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 HTML
pdfFile
- the File
containing the resulting PDF
converterProperties
- a ConverterProperties
instance
IOException
- 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 HTML
pdfStream
- the OutputStream
for the resulting PDF
IOException
- 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 HTML
pdfStream
- the OutputStream
for the resulting PDF
converterProperties
- a ConverterProperties
instance
IOException
- 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 HTML
pdfDocument
- the PdfDocument
instance
IOException
- 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 HTML
pdfWriter
- the PdfWriter
containing the resulting PDF
IOException
- 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 HTML
pdfWriter
- the PdfWriter
containing the resulting PDF
converterProperties
- a ConverterProperties
instance
IOException
- 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 HTML
pdfDocument
- the PdfDocument
instance
converterProperties
- a ConverterProperties
instance
IOException
- 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 String
pdfWriter
- the PdfWriter
containing the resulting PDF
Document
instance
IOException
- 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 HTML
pdfWriter
- the PdfWriter
containing the resulting PDF
Document
instance
IOException
- 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 String
pdfWriter
- the pdf writer
converterProperties
- a ConverterProperties
instance
Document
instance
IOException
- 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 stream
pdfWriter
- the pdf writer
converterProperties
- a ConverterProperties
instance
Document
instance
IOException
- 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 String
pdfDocument
- the PdfDocument
instance
converterProperties
- a ConverterProperties
instance
Document
instance
IOException
- 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 HTML
pdfDocument
- the PdfDocument
instance
converterProperties
- a ConverterProperties
instance
Document
instance
IOException
- Signals that an I/O exception has occurred.
public static ListconvertToElements(String html) throws IOException
html
- the html in the form of a String
IOException
- Signals that an I/O exception has occurred.
public static ListconvertToElements(InputStream htmlStream) throws IOException
htmlStream
- the InputStream
with the source HTML
IOException
- Signals that an I/O exception has occurred.
public static ListconvertToElements(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 String
converterProperties
- a ConverterProperties
instance
IOException
- Signals that an I/O exception has occurred.
public static ListconvertToElements(InputStream htmlStream, ConverterProperties converterProperties) throws IOException
InputStream
to a List
of iText objects (IElement
instances), using specific ConverterProperties
.
htmlStream
- the InputStream
with the source HTML
converterProperties
- a ConverterProperties
instance
IOException
- Signals that an I/O exception has occurred.
Copyright © 1998–2019 iText Group NV. All rights reserved.