PageConvertToHtml Method (Resolution, TextExtractionOptions, Boolean)

Apitron PDF Kit help
Apitron.PDF.Kit library for .NET
Converts the page to HTML by combining content returned by ExtractText(TextExtractionOptions, Boolean) and ExtractDrawings(Resolution).

Namespace:  Apitron.PDF.Kit.FixedLayout
Assembly:  Apitron.PDF.Kit (in Apitron.PDF.Kit.dll) Version: (

public string ConvertToHtml(
	Resolution desiredResolution = null,
	TextExtractionOptions options = TextExtractionOptions.HtmlPage,
	bool processBiDiText = false


desiredResolution (Optional)
Type: Apitron.PDF.Kit.ConfigurationResolution
Desired resolution, default is 72 dpi.
options (Optional)
Type: Apitron.PDF.Kit.ExtractionTextExtractionOptions
Text extraction options. Only HtmlFragment and HtmlPage are allowed.
processBiDiText (Optional)
Type: SystemBoolean
Text extraction algorithm will try to detect and reorder bi-directional strings.

Return Value

Type: String
A string that contains resulting HTML. All images will be embedded using data URIs.

using (Stream stream = new FileStream("document.pdf", FileMode.Open))
    FixedDocument document = new FixedDocument(stream);
    for (int i = 0; i<document.Pages.Count; i++)
        Page page = document.Pages[i];
        string str = page.ConvertToHtml(new Resolution(150, 150), TextExtractionOptions.HtmlPage, true);

        FileStream fileStream = new FileInfo(string.Format("page{0}.html", i)).Create();
        using (StreamWriter writer = new StreamWriter(fileStream))
See Also