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
intThe 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
intThe HTML viewer width in pixels
htmlViewerHeight
intThe 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
stringThe 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
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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
baseUrl
stringThe 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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe 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
stringThe 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
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
stringThe HTML string to convert
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe 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
stringThe 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
stringThe 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
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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
baseUrl
stringThe 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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe 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
stringThe 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
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
stringThe HTML string to convert
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe 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
stringThe 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
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
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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
outFile
stringThe 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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
outFile
stringThe output PDF file
baseUrl
stringThe 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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
outFile
stringThe output PDF file
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe 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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
outPdfStream
StreamThe 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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
baseUrl
stringThe base URL
outPdfStream
StreamThe 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
StreamThe HTML stream
textEncoding
EncodingThe stream text encoding
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe internal links base URL
outPdfStream
StreamThe 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
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
stringThe HTML string to convert
outFile
stringThe output PDF file
baseUrl
stringThe 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
stringThe HTML string to convert
outFile
stringThe output PDF file
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe 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
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
stringThe HTML string to convert
baseUrl
stringThe base URL
outPdfStream
StreamThe 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
stringThe HTML string to convert
baseUrl
stringThe base URL
internalLinksBaseUrl
stringThe internal links base URL
outPdfStream
StreamThe 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
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)