PdfFocusCHtmlOptionsImageNumStart Property |
The starting number for naming images in the HTML document. Default value: 1.
Namespace: SautinSoftAssembly: SautinSoft.PdfFocus (in SautinSoft.PdfFocus.dll) Version: 2024.11.11
Syntax public int ImageNumStart { get; set; }
Public Property ImageNumStart As Integer
Get
Set
Property Value
Int32Remarks
In case of the "5" value, the extracted images will be named image5.png, image6.png, imageN.png
Example How to set a location of images during PDF to HTML in C#
using System;
using System.IO;
using SautinSoft;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
string pdfFile = Path.GetFullPath(@"..\..\..\simple text.pdf");
string htmlFile = "Result.html";
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
f.HtmlOptions.ImageFolder = Path.GetDirectoryName(htmlFile);
f.EmbeddedImagesFormat = PdfFocus.eImageFormat.Jpeg;
f.EmbeddedJpegQuality = 95;
f.HtmlOptions.ImageSubFolder = String.Format("{0}_images", Path.GetFileNameWithoutExtension(pdfFile));
f.HtmlOptions.ImageFileName = "picture";
f.HtmlOptions.ImageNumStart = 100;
f.HtmlOptions.IncludeImageInHtml = false;
f.OpenPdf(pdfFile);
if (f.PageCount > 0)
{
int res = f.ToHtml(htmlFile);
if (res == 0)
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(htmlFile) { UseShellExecute = true });
}
}
}
}
How to set a location of images during PDF to HTML in 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("..\..\..\simple text.pdf")
Dim htmlFile As String = "Result.html"
Dim f As New SautinSoft.PdfFocus()
f.HtmlOptions.ImageFolder = Path.GetDirectoryName(htmlFile)
f.EmbeddedImagesFormat = PdfFocus.eImageFormat.Jpeg
f.EmbeddedJpegQuality = 95
f.HtmlOptions.ImageSubFolder = String.Format("{0}_images", Path.GetFileNameWithoutExtension(pdfFile))
f.HtmlOptions.ImageFileName = "picture"
f.HtmlOptions.ImageNumStart = 100
f.HtmlOptions.IncludeImageInHtml = False
f.OpenPdf(pdfFile)
If f.PageCount > 0 Then
Dim res As Integer = f.ToHtml(htmlFile)
If res = 0 Then
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(htmlFile) With {.UseShellExecute = True})
End If
End If
End Sub
End Class
End Namespace
See Also