pdfHTML 5.0.5 API
iText.Html2pdf.HtmlConverter Class Reference

The HtmlConverter is the class you will use most when converting HTML to PDF. More...

Static Public Member Functions

static void  ConvertToPdf (String html, Stream pdfStream)
  Converts a System.String containing HTML to an System.IO.Stream containing PDF. More...
 
static void  ConvertToPdf (String html, Stream pdfStream, ConverterProperties converterProperties)
  Converts a System.String containing HTML to an System.IO.Stream containing PDF, using specific ConverterProperties. More...
 
static void  ConvertToPdf (String html, PdfWriter pdfWriter)
  Converts a System.String containing HTML to PDF by writing PDF content to a iText.Kernel.Pdf.PdfWriter instance. More...
 
static void  ConvertToPdf (String html, PdfWriter pdfWriter, ConverterProperties converterProperties)
  Converts a System.String containing HTML to PDF by writing PDF content to a iText.Kernel.Pdf.PdfWriter instance, using specific ConverterProperties. More...
 
static void  ConvertToPdf (String html, PdfDocument pdfDocument, ConverterProperties converterProperties)
  Converts a System.String containing HTML to objects that will be added to a iText.Kernel.Pdf.PdfDocument , using specific ConverterProperties. More...
 
static void  ConvertToPdf (FileInfo htmlFile, FileInfo pdfFile)
  Converts HTML stored in a System.IO.FileInfo to a PDF System.IO.FileInfo. More...
 
static void  ConvertToPdf (FileInfo htmlFile, FileInfo pdfFile, ConverterProperties converterProperties)
  Converts HTML stored in a System.IO.FileInfo to a PDF System.IO.FileInfo , using specific ConverterProperties. More...
 
static void  ConvertToPdf (Stream htmlStream, Stream pdfStream)
  Converts HTML obtained from an System.IO.Stream to a PDF written to an System.IO.Stream. More...
 
static void  ConvertToPdf (Stream htmlStream, Stream pdfStream, ConverterProperties converterProperties)
  Converts HTML obtained from an System.IO.Stream to a PDF written to an System.IO.Stream. More...
 
static void  ConvertToPdf (Stream htmlStream, PdfDocument pdfDocument)
  Converts HTML obtained from an System.IO.Stream to objects that will be added to a iText.Kernel.Pdf.PdfDocument. More...
 
static void  ConvertToPdf (Stream htmlStream, PdfWriter pdfWriter)
  Converts HTML obtained from an System.IO.Stream to content that will be written to a iText.Kernel.Pdf.PdfWriter. More...
 
static void  ConvertToPdf (Stream htmlStream, PdfWriter pdfWriter, ConverterProperties converterProperties)
  Converts HTML obtained from an System.IO.Stream to content that will be written to a iText.Kernel.Pdf.PdfWriter , using specific ConverterProperties. More...
 
static void  ConvertToPdf (Stream htmlStream, PdfDocument pdfDocument, ConverterProperties converterProperties)
  Converts HTML obtained from an System.IO.Stream to objects that will be added to a iText.Kernel.Pdf.PdfDocument , using specific ConverterProperties. More...
 
static Document  ConvertToDocument (String html, PdfWriter pdfWriter)
  Converts a System.String containing HTML to content that will be written to a iText.Kernel.Pdf.PdfWriter , returning a iText.Layout.Document instance. More...
 
static Document  ConvertToDocument (Stream htmlStream, PdfWriter pdfWriter)
  Converts HTML obtained from an System.IO.Stream to content that will be written to a iText.Kernel.Pdf.PdfWriter , returning a iText.Layout.Document instance. More...
 
static Document  ConvertToDocument (String html, PdfWriter pdfWriter, ConverterProperties converterProperties)
  Converts a System.String containing HTML to content that will be written to a iText.Kernel.Pdf.PdfWriter , using specific ConverterProperties , returning a iText.Layout.Document instance. More...
 
static Document  ConvertToDocument (Stream htmlStream, PdfWriter pdfWriter, ConverterProperties converterProperties)
  Converts HTML obtained from an System.IO.Stream to content that will be written to a iText.Kernel.Pdf.PdfWriter , using specific ConverterProperties , returning a iText.Layout.Document instance. More...
 
static Document  ConvertToDocument (String html, PdfDocument pdfDocument, ConverterProperties converterProperties)
  Converts a System.String containing HTML to objects that will be added to a iText.Kernel.Pdf.PdfDocument , using specific ConverterProperties , returning a iText.Layout.Document instance. More...
 
static Document  ConvertToDocument (Stream htmlStream, PdfDocument pdfDocument, ConverterProperties converterProperties)
  Converts HTML obtained from an System.IO.Stream to objects that will be added to a iText.Kernel.Pdf.PdfDocument , using specific ConverterProperties , returning a iText.Layout.Document instance. More...
 
static IList< IElement >  ConvertToElements (String html)
  Converts a System.String containing HTML to a System.Collections.IList of iText objects ( iText.Layout.Element.IElement instances). More...
 
static IList< IElement >  ConvertToElements (Stream htmlStream)
  Converts HTML obtained from an System.IO.Stream to a System.Collections.IList of iText objects ( iText.Layout.Element.IElement instances). More...
 
static IList< IElement >  ConvertToElements (String html, ConverterProperties converterProperties)
  Converts a System.String containing HTML to a System.Collections.IList of iText objects ( iText.Layout.Element.IElement instances), using specific ConverterProperties. More...
 
static IList< IElement >  ConvertToElements (Stream htmlStream, ConverterProperties converterProperties)
  Converts HTML obtained from an System.IO.Stream to a System.Collections.IList of iText objects ( iText.Layout.Element.IElement instances), using specific ConverterProperties. More...
 

Detailed Description

The HtmlConverter is the class you will use most when converting HTML to PDF.

The HtmlConverter is the class you will use most when converting HTML to PDF. It contains a series of static methods that accept HTML as a System.String , System.IO.FileInfo , or System.IO.Stream , and convert it to PDF in the form of an System.IO.Stream , System.IO.FileInfo , or a series of iText elements. It's also possible to write to a iText.Kernel.Pdf.PdfWriter or iText.Kernel.Pdf.PdfDocument instance.

Member Function Documentation

◆ ConvertToDocument() [1/6]

static Document iText.Html2pdf.HtmlConverter.ConvertToDocument ( Stream  htmlStream,
PdfDocument  pdfDocument,
ConverterProperties  converterProperties 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to objects that will be added to a iText.Kernel.Pdf.PdfDocument , using specific ConverterProperties , returning a iText.Layout.Document instance.

Parameters
htmlStream the System.IO.Stream with the source HTML
pdfDocument the iText.Kernel.Pdf.PdfDocument instance
converterProperties a ConverterProperties instance
Returns
a iText.Layout.Document instance

◆ ConvertToDocument() [2/6]

static Document iText.Html2pdf.HtmlConverter.ConvertToDocument ( Stream  htmlStream,
PdfWriter  pdfWriter 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to content that will be written to a iText.Kernel.Pdf.PdfWriter , returning a iText.Layout.Document instance.

Parameters
htmlStream the System.IO.Stream with the source HTML
pdfWriter the iText.Kernel.Pdf.PdfWriter containing the resulting PDF
Returns
a iText.Layout.Document instance

◆ ConvertToDocument() [3/6]

static Document iText.Html2pdf.HtmlConverter.ConvertToDocument ( Stream  htmlStream,
PdfWriter  pdfWriter,
ConverterProperties  converterProperties 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to content that will be written to a iText.Kernel.Pdf.PdfWriter , using specific ConverterProperties , returning a iText.Layout.Document instance.

Parameters
htmlStream the html stream
pdfWriter the pdf writer
converterProperties a ConverterProperties instance
Returns
a iText.Layout.Document instance

◆ ConvertToDocument() [4/6]

static Document iText.Html2pdf.HtmlConverter.ConvertToDocument ( String  html,
PdfDocument  pdfDocument,
ConverterProperties  converterProperties 
)
inlinestatic

Converts a System.String containing HTML to objects that will be added to a iText.Kernel.Pdf.PdfDocument , using specific ConverterProperties , returning a iText.Layout.Document instance.

Parameters
html the html in the form of a System.String
pdfDocument the iText.Kernel.Pdf.PdfDocument instance
converterProperties a ConverterProperties instance
Returns
a iText.Layout.Document instance

◆ ConvertToDocument() [5/6]

static Document iText.Html2pdf.HtmlConverter.ConvertToDocument ( String  html,
PdfWriter  pdfWriter 
)
inlinestatic

Converts a System.String containing HTML to content that will be written to a iText.Kernel.Pdf.PdfWriter , returning a iText.Layout.Document instance.

Parameters
html the html in the form of a System.String
pdfWriter the iText.Kernel.Pdf.PdfWriter containing the resulting PDF
Returns
a iText.Layout.Document instance

◆ ConvertToDocument() [6/6]

static Document iText.Html2pdf.HtmlConverter.ConvertToDocument ( String  html,
PdfWriter  pdfWriter,
ConverterProperties  converterProperties 
)
inlinestatic

Converts a System.String containing HTML to content that will be written to a iText.Kernel.Pdf.PdfWriter , using specific ConverterProperties , returning a iText.Layout.Document instance.

Parameters
html the html in the form of a System.String
pdfWriter the pdf writer
converterProperties a ConverterProperties instance
Returns
a iText.Layout.Document instance

◆ ConvertToElements() [1/4]

static IList iText.Html2pdf.HtmlConverter.ConvertToElements ( Stream  htmlStream )
inlinestatic

Converts HTML obtained from an System.IO.Stream to a System.Collections.IList of iText objects ( iText.Layout.Element.IElement instances).

Parameters
htmlStream the System.IO.Stream with the source HTML
Returns
a list of iText building blocks

◆ ConvertToElements() [2/4]

static IList iText.Html2pdf.HtmlConverter.ConvertToElements ( Stream  htmlStream,
ConverterProperties  converterProperties 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to a System.Collections.IList of iText objects ( iText.Layout.Element.IElement instances), using specific ConverterProperties.

Parameters
htmlStream the System.IO.Stream with the source HTML
converterProperties a ConverterProperties instance
Returns
a list of iText building blocks

◆ ConvertToElements() [3/4]

static IList iText.Html2pdf.HtmlConverter.ConvertToElements ( String  html )
inlinestatic

Converts a System.String containing HTML to a System.Collections.IList of iText objects ( iText.Layout.Element.IElement instances).

Parameters
html the html in the form of a System.String
Returns
a list of iText building blocks

◆ ConvertToElements() [4/4]

static IList iText.Html2pdf.HtmlConverter.ConvertToElements ( String  html,
ConverterProperties  converterProperties 
)
inlinestatic

Converts a System.String containing HTML to a System.Collections.IList of iText objects ( iText.Layout.Element.IElement instances), using specific ConverterProperties.

Parameters
html the html in the form of a System.String
converterProperties a ConverterProperties instance
Returns
a list of iText building blocks

◆ ConvertToPdf() [1/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( FileInfo  htmlFile,
FileInfo  pdfFile 
)
inlinestatic

Converts HTML stored in a System.IO.FileInfo to a PDF System.IO.FileInfo.

Parameters
htmlFile the System.IO.FileInfo containing the source HTML
pdfFile the System.IO.FileInfo containing the resulting PDF

◆ ConvertToPdf() [2/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( FileInfo  htmlFile,
FileInfo  pdfFile,
ConverterProperties  converterProperties 
)
inlinestatic

Converts HTML stored in a System.IO.FileInfo to a PDF System.IO.FileInfo , using specific ConverterProperties.

Parameters
htmlFile the System.IO.FileInfo containing the source HTML
pdfFile the System.IO.FileInfo containing the resulting PDF
converterProperties a ConverterProperties instance

◆ ConvertToPdf() [3/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( Stream  htmlStream,
PdfDocument  pdfDocument 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to objects that will be added to a iText.Kernel.Pdf.PdfDocument.

Parameters
htmlStream the System.IO.Stream with the source HTML
pdfDocument the iText.Kernel.Pdf.PdfDocument instance

◆ ConvertToPdf() [4/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( Stream  htmlStream,
PdfDocument  pdfDocument,
ConverterProperties  converterProperties 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to objects that will be added to a iText.Kernel.Pdf.PdfDocument , using specific ConverterProperties.

Parameters
htmlStream the System.IO.Stream with the source HTML
pdfDocument the iText.Kernel.Pdf.PdfDocument instance
converterProperties a ConverterProperties instance

◆ ConvertToPdf() [5/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( Stream  htmlStream,
PdfWriter  pdfWriter 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to content that will be written to a iText.Kernel.Pdf.PdfWriter.

Parameters
htmlStream the System.IO.Stream with the source HTML
pdfWriter the iText.Kernel.Pdf.PdfWriter containing the resulting PDF

◆ ConvertToPdf() [6/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( Stream  htmlStream,
PdfWriter  pdfWriter,
ConverterProperties  converterProperties 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to content that will be written to a iText.Kernel.Pdf.PdfWriter , using specific ConverterProperties.

Parameters
htmlStream the System.IO.Stream with the source HTML
pdfWriter the iText.Kernel.Pdf.PdfWriter containing the resulting PDF
converterProperties a ConverterProperties instance

◆ ConvertToPdf() [7/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( Stream  htmlStream,
Stream  pdfStream 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to a PDF written to an System.IO.Stream.

Parameters
htmlStream the System.IO.Stream with the source HTML
pdfStream the System.IO.Stream for the resulting PDF

◆ ConvertToPdf() [8/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( Stream  htmlStream,
Stream  pdfStream,
ConverterProperties  converterProperties 
)
inlinestatic

Converts HTML obtained from an System.IO.Stream to a PDF written to an System.IO.Stream.

Parameters
htmlStream the System.IO.Stream with the source HTML
pdfStream the System.IO.Stream for the resulting PDF
converterProperties a ConverterProperties instance

◆ ConvertToPdf() [9/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( String  html,
PdfDocument  pdfDocument,
ConverterProperties  converterProperties 
)
inlinestatic

Converts a System.String containing HTML to objects that will be added to a iText.Kernel.Pdf.PdfDocument , using specific ConverterProperties.

Parameters
html the html in the form of a System.String
pdfDocument the iText.Kernel.Pdf.PdfDocument instance
converterProperties a ConverterProperties instance

◆ ConvertToPdf() [10/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( String  html,
PdfWriter  pdfWriter 
)
inlinestatic

Converts a System.String containing HTML to PDF by writing PDF content to a iText.Kernel.Pdf.PdfWriter instance.

Parameters
html the html in the form of a System.String
pdfWriter the iText.Kernel.Pdf.PdfWriter instance

◆ ConvertToPdf() [11/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( String  html,
PdfWriter  pdfWriter,
ConverterProperties  converterProperties 
)
inlinestatic

Converts a System.String containing HTML to PDF by writing PDF content to a iText.Kernel.Pdf.PdfWriter instance, using specific ConverterProperties.

Parameters
html the html in the form of a System.String
pdfWriter the iText.Kernel.Pdf.PdfWriter instance
converterProperties a ConverterProperties instance

◆ ConvertToPdf() [12/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( String  html,
Stream  pdfStream 
)
inlinestatic

Converts a System.String containing HTML to an System.IO.Stream containing PDF.

Parameters
html the html in the form of a System.String
pdfStream the PDF as an System.IO.Stream

◆ ConvertToPdf() [13/13]

static void iText.Html2pdf.HtmlConverter.ConvertToPdf ( String  html,
Stream  pdfStream,
ConverterProperties  converterProperties 
)
inlinestatic

Converts a System.String containing HTML to an System.IO.Stream containing PDF, using specific ConverterProperties.

Parameters
html the html in the form of a System.String
pdfStream the PDF as an System.IO.Stream
converterProperties a ConverterProperties instance