PdfFocusCHtmlOptionsRenderMode Property |
Gets or sets the rendering mode for the output HTML: Fixed or Flowing. Default value:
Fixed.
Namespace: SautinSoftAssembly: SautinSoft.PdfFocus (in SautinSoft.PdfFocus.dll) Version: 2024.9.26
Syntax public PdfFocusCHtmlOptionseHtmlRenderMode RenderMode { get; set; }
Public Property RenderMode As PdfFocusCHtmlOptionseHtmlRenderMode
Get
Set
Property Value
PdfFocusCHtmlOptionseHtmlRenderModeRemarks
The HTML-
Fixed is better to use for rendering, because it completely mirrors the PDF layout with structure of pages.
The HTML-
Flowing is better for further processing: editing and combining. The markup of such documents has a flowing structure. It's much simple for understanding by a human. But the resulting HTML document may look not exactly the same as input PDF pixel by pixel.
Default value:
Fixed.
Example Convert PDF to HTML-Fixed and HTML-Flowing formats using C#
using System;
using System.IO;
using SautinSoft;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
string pdfFile = Path.GetFullPath(@"..\..\..\License.pdf");
string htmlFileFixed = "Fixed.html";
string htmlFileFlowing = "Flowing.html";
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
f.HtmlOptions.IncludeImageInHtml = true;
f.OpenPdf(pdfFile);
if (f.PageCount > 0)
{
f.HtmlOptions.Title = "Fixed";
f.HtmlOptions.RenderMode = PdfFocus.CHtmlOptions.eHtmlRenderMode.Fixed;
if (f.ToHtml(htmlFileFixed)==0)
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(htmlFileFixed) { UseShellExecute = true });
f.HtmlOptions.Title = "Flowing";
f.HtmlOptions.RenderMode = PdfFocus.CHtmlOptions.eHtmlRenderMode.Flowing;
f.HtmlOptions.KeepCharScaleAndSpacing = false;
if (f.ToHtml(htmlFileFlowing) == 0)
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(htmlFileFlowing) { UseShellExecute = true });
}
}
}
}
Convert PDF to HTML-Fixed and HTML-Flowing formats using VB.Net
Imports System
Imports System.IO
Imports SautinSoft
Namespace Sample
Friend Class Sample
Shared Sub Main(ByVal args() As String)
Dim pdfFile As String = Path.GetFullPath("..\..\..\License.pdf")
Dim htmlFileFixed As String = "Fixed.html"
Dim htmlFileFlowing As String = "Flowing.html"
Dim f As New SautinSoft.PdfFocus()
f.HtmlOptions.IncludeImageInHtml = True
f.OpenPdf(pdfFile)
If f.PageCount > 0 Then
f.HtmlOptions.Title = "Fixed"
f.HtmlOptions.RenderMode = PdfFocus.CHtmlOptions.eHtmlRenderMode.Fixed
If f.ToHtml(htmlFileFixed) = 0 Then
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(htmlFileFixed) With {.UseShellExecute = True})
End If
f.HtmlOptions.Title = "Flowing"
f.HtmlOptions.RenderMode = PdfFocus.CHtmlOptions.eHtmlRenderMode.Flowing
f.HtmlOptions.KeepCharScaleAndSpacing = False
If f.ToHtml(htmlFileFlowing) = 0 Then
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(htmlFileFlowing) With {.UseShellExecute = True})
End If
End If
End Sub
End Class
End Namespace
See Also