Table of Contents

Class PdfConverter

Namespace
EvoPdf
Assembly
evohtmltopdf.dll

This class represents the HTML to PDF converter and offers the necessary properties and methods to convert HTML documents to PDF. This class is still present in the API to maintain the backward compatibility and it will be replaced by HtmlToPdfConverter class in the future versions

[ClassInterface(ClassInterfaceType.AutoDual)]
public class PdfConverter : HtmlToPdfConverter
Inheritance
PdfConverter
Inherited Members

Constructors

PdfConverter()

This constructor creates a HTML to PDF converter using the default width and height for the HTML viewer

public PdfConverter()

PdfConverter(int)

This constructor creates a HTML to PDF converter using the given width in pixels and the default height for the HTML viewer

public PdfConverter(int htmlViewerWidth)

Parameters

htmlViewerWidth int

The HTML viewer width in pixels

PdfConverter(int, int)

This constructor creates a HTML to PDF converter using the given width and height in pixels of the HTML viewer

public PdfConverter(int htmlViewerWidth, int htmlViewerHeight)

Parameters

htmlViewerWidth int

The HTML viewer width in pixels

htmlViewerHeight int

The HTML viewer height in pixels

Methods

GetPdfBytesFromHtmlFile(string)

Converts a HTML file to PDF. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlFile(string) method in the future versions

public byte[] GetPdfBytesFromHtmlFile(string htmlFilePath)

Parameters

htmlFilePath string

The HTML file to convert

Returns

byte[]

The PDF document bytes

GetPdfBytesFromHtmlStream(Stream, Encoding)

Converts a HTML from a stream to PDF. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStream(Stream, Encoding, string) method in the future versions

public byte[] GetPdfBytesFromHtmlStream(Stream htmlStream, Encoding textEncoding)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

Returns

byte[]

The PDF document bytes

GetPdfBytesFromHtmlStream(Stream, Encoding, string)

Converts a HTML from a stream to PDF using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStream(Stream, Encoding, string) method in the future versions

public byte[] GetPdfBytesFromHtmlStream(Stream htmlStream, Encoding textEncoding, string baseUrl)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

baseUrl string

The base URL

Returns

byte[]

The PDF document bytes

GetPdfBytesFromHtmlStream(Stream, Encoding, string, string)

Converts a HTML from a stream to PDF using a base URL and an internal links base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStream(Stream, Encoding, string, string) method in the future versions

public byte[] GetPdfBytesFromHtmlStream(Stream htmlStream, Encoding textEncoding, string baseUrl, string internalLinksBaseUrl)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

baseUrl string

The base URL

internalLinksBaseUrl string

The internal links base URL

Returns

byte[]

The PDF document bytes

GetPdfBytesFromHtmlString(string)

Converts a HTML string to PDF. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtml(string, string) method in the future versions

public byte[] GetPdfBytesFromHtmlString(string htmlString)

Parameters

htmlString string

The HTML string to convert

Returns

byte[]

The PDF document bytes

GetPdfBytesFromHtmlString(string, string)

Converts a HTML string to PDF using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtml(string, string) method in the future versions

public byte[] GetPdfBytesFromHtmlString(string htmlString, string baseUrl)

Parameters

htmlString string

The HTML string to convert

baseUrl string

The base URL

Returns

byte[]

The PDF document bytes

GetPdfBytesFromHtmlString(string, string, string)

Converts a HTML string to PDF using a base URL and an internal links base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtml(string, string, string) method in the future versions

public byte[] GetPdfBytesFromHtmlString(string htmlString, string baseUrl, string internalLinksBaseUrl)

Parameters

htmlString string

The HTML string to convert

baseUrl string

The base URL

internalLinksBaseUrl string

The base URL

Returns

byte[]

The PDF document bytes

GetPdfBytesFromUrl(string)

Converts an URL to PDF. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertUrl(string) method in the future versions

public byte[] GetPdfBytesFromUrl(string url)

Parameters

url string

The URL to convert

Returns

byte[]

The PDF document bytes

GetPdfDocumentObjectFromHtmlFile(string)

Converts a HTML file to a PDF document object. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlFileToPdfDocumentObject(string) method in the future versions

public Document GetPdfDocumentObjectFromHtmlFile(string htmlFilePath)

Parameters

htmlFilePath string

The HTML file to convert

Returns

Document

The PDF document object

GetPdfDocumentObjectFromHtmlStream(Stream, Encoding)

Converts a HTML from a stream to PDF document object. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToPdfDocumentObject(Stream, Encoding, string) method in the future versions

public Document GetPdfDocumentObjectFromHtmlStream(Stream htmlStream, Encoding textEncoding)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

Returns

Document

The PDF document object

GetPdfDocumentObjectFromHtmlStream(Stream, Encoding, string)

Converts a HTML from a stream to a PDF document object using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToPdfDocumentObject(Stream, Encoding, string) method in the future versions

public Document GetPdfDocumentObjectFromHtmlStream(Stream htmlStream, Encoding textEncoding, string baseUrl)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

baseUrl string

The base URL

Returns

Document

The PDF document object

GetPdfDocumentObjectFromHtmlStream(Stream, Encoding, string, string)

Converts a HTML from a stream to a PDF document object using a base URL and an internal links base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToPdfDocumentObject(Stream, Encoding, string, string) method in the future versions

public Document GetPdfDocumentObjectFromHtmlStream(Stream htmlStream, Encoding textEncoding, string baseUrl, string internalLinksBaseUrl)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

baseUrl string

The base URL

internalLinksBaseUrl string

The internal links base URL

Returns

Document

The PDF document object

GetPdfDocumentObjectFromHtmlString(string)

Converts a HTML string to PDF document object. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToPdfDocumentObject(string, string) method in the future versions

public Document GetPdfDocumentObjectFromHtmlString(string htmlString)

Parameters

htmlString string

The HTML string to convert

Returns

Document

The PDF document object

GetPdfDocumentObjectFromHtmlString(string, string)

Converts a HTML string to a PDF document object using a base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToPdfDocumentObject(string, string) method in the future versions

public Document GetPdfDocumentObjectFromHtmlString(string htmlString, string baseUrl)

Parameters

htmlString string

The HTML string to convert

baseUrl string

The base URL

Returns

Document

The PDF document object

GetPdfDocumentObjectFromHtmlString(string, string, string)

Converts a HTML string to a PDF document object using a base URL and an internal links base URL. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToPdfDocumentObject(string, string, string) method in the future versions

public Document GetPdfDocumentObjectFromHtmlString(string htmlString, string baseUrl, string internalLinksBaseUrl)

Parameters

htmlString string

The HTML string to convert

baseUrl string

The base URL

internalLinksBaseUrl string

The internal links base URL

Returns

Document

The PDF document object

GetPdfDocumentObjectFromUrl(string)

Converts an URL to PDF document object. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertUrlToPdfDocumentObject(string) method in the future versions

public Document GetPdfDocumentObjectFromUrl(string url)

Parameters

url string

The URL to convert

Returns

Document

The PDF document object

SavePdfFromHtmlFileToFile(string, string)

Converts a HTML file to PDF and saves the rendered PDF document into a file. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlFileToFile(string, string) method in the future versions

public void SavePdfFromHtmlFileToFile(string htmlFilePath, string outFile)

Parameters

htmlFilePath string

The HTML file to convert

outFile string

The output PDF file

SavePdfFromHtmlFileToStream(string, Stream)

Converts a HTML file to PDF and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlFileToStream(string, Stream) method in the future versions

public void SavePdfFromHtmlFileToStream(string htmlFilePath, Stream outPdfStream)

Parameters

htmlFilePath string

The HTML file to convert

outPdfStream Stream

The output stream

SavePdfFromHtmlStreamToFile(Stream, Encoding, string)

Converts the HTML string read from a stream to PDF and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToFile(Stream, Encoding, string, string) method in the future versions

public void SavePdfFromHtmlStreamToFile(Stream htmlStream, Encoding textEncoding, string outFile)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

outFile string

The output PDF file

SavePdfFromHtmlStreamToFile(Stream, Encoding, string, string)

Converts a HTML string read from a stream to PDF using a base URL and saves the rendered PDF document into a fil. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToFile(Stream, Encoding, string, string) method in the future versions

public void SavePdfFromHtmlStreamToFile(Stream htmlStream, Encoding textEncoding, string outFile, string baseUrl)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

outFile string

The output PDF file

baseUrl string

The base URL

SavePdfFromHtmlStreamToFile(Stream, Encoding, string, string, string)

Converts a HTML string read from a stream to PDF using a base URL and an internal links base URL and saves the rendered PDF document into a fil. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToFile(Stream, Encoding, string, string, string) method in the future versions

public void SavePdfFromHtmlStreamToFile(Stream htmlStream, Encoding textEncoding, string outFile, string baseUrl, string internalLinksBaseUrl)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

outFile string

The output PDF file

baseUrl string

The base URL

internalLinksBaseUrl string

The internal links base URL

SavePdfFromHtmlStreamToStream(Stream, Encoding, Stream)

Converts the HTML string read from a stream to PDF and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToStream(Stream, Encoding, string, Stream) method in the future versions

public void SavePdfFromHtmlStreamToStream(Stream htmlStream, Encoding textEncoding, Stream outPdfStream)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

outPdfStream Stream

The output stream

SavePdfFromHtmlStreamToStream(Stream, Encoding, string, Stream)

Converts a HTML string read from a stream to PDF using a base URL and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToStream(Stream, Encoding, string, Stream) method in the future versions

public void SavePdfFromHtmlStreamToStream(Stream htmlStream, Encoding textEncoding, string baseUrl, Stream outPdfStream)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

baseUrl string

The base URL

outPdfStream Stream

The output stream

SavePdfFromHtmlStreamToStream(Stream, Encoding, string, string, Stream)

Converts a HTML string read from a stream to PDF using a base URL and an internal links base URL and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlStreamToStream(Stream, Encoding, string, string, Stream) method in the future versions

public void SavePdfFromHtmlStreamToStream(Stream htmlStream, Encoding textEncoding, string baseUrl, string internalLinksBaseUrl, Stream outPdfStream)

Parameters

htmlStream Stream

The HTML stream

textEncoding Encoding

The stream text encoding

baseUrl string

The base URL

internalLinksBaseUrl string

The internal links base URL

outPdfStream Stream

The output stream

SavePdfFromHtmlStringToFile(string, string)

Converts a HTML string to PDF and saves the rendered PDF document into a file. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToFile(string, string, string) method in the future versions

public void SavePdfFromHtmlStringToFile(string htmlString, string outFile)

Parameters

htmlString string

The HTML string to convert

outFile string

The output PDF file

SavePdfFromHtmlStringToFile(string, string, string)

Converts a HTML string to PDF using a base URL and saves the rendered PDF document into a file. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToFile(string, string, string) method in the future versions

public void SavePdfFromHtmlStringToFile(string htmlString, string outFile, string baseUrl)

Parameters

htmlString string

The HTML string to convert

outFile string

The output PDF file

baseUrl string

The base URL

SavePdfFromHtmlStringToFile(string, string, string, string)

Converts a HTML string to PDF using a base URL and an internal links base URL and saves the rendered PDF document into a file. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToFile(string, string, string, string) method in the future versions

public void SavePdfFromHtmlStringToFile(string htmlString, string outFile, string baseUrl, string internalLinksBaseUrl)

Parameters

htmlString string

The HTML string to convert

outFile string

The output PDF file

baseUrl string

The base URL

internalLinksBaseUrl string

The internal links base URL

SavePdfFromHtmlStringToStream(string, Stream)

Converts a HTML string to PDF and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToStream(string, string, Stream) method in the future versions

public void SavePdfFromHtmlStringToStream(string htmlString, Stream outPdfStream)

Parameters

htmlString string

The HTML string to convert

outPdfStream Stream

The output stream

SavePdfFromHtmlStringToStream(string, string, Stream)

Converts a HTML string to PDF using a base URL and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToStream(string, string, Stream) method in the future versions

public void SavePdfFromHtmlStringToStream(string htmlString, string baseUrl, Stream outPdfStream)

Parameters

htmlString string

The HTML string to convert

baseUrl string

The base URL

outPdfStream Stream

The output stream

SavePdfFromHtmlStringToStream(string, string, string, Stream)

Converts a HTML string to PDF using a base URL and an internal links base URL and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertHtmlToStream(string, string, string, Stream) method in the future versions

public void SavePdfFromHtmlStringToStream(string htmlString, string baseUrl, string internalLinksBaseUrl, Stream outPdfStream)

Parameters

htmlString string

The HTML string to convert

baseUrl string

The base URL

internalLinksBaseUrl string

The internal links base URL

outPdfStream Stream

The output stream

SavePdfFromUrlToFile(string, string)

Converts an URL to PDF and saves the rendered PDF document into a file. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertUrlToFile(string, string) method in the future versions

public void SavePdfFromUrlToFile(string url, string outFile)

Parameters

url string

The URL to convert

outFile string

The output file

SavePdfFromUrlToStream(string, Stream)

Converts an URL to PDF and saves the rendered PDF document into a stream. This method is still present in the API to maintain the backward compatibility and it will be replaced by ConvertUrlToStream(string, Stream) method in the future versions

public void SavePdfFromUrlToStream(string url, Stream outPdfStream)

Parameters

url string

The URL to convert

outPdfStream Stream

The output stream