PdfFocusCHtmlOptionsImageFolder Property |
Gets or sets a path to a directory to store images after converting. Notice also to the property "ImageSubFolder". Default value: "".
Namespace: SautinSoftAssembly: SautinSoft.PdfFocus (in SautinSoft.PdfFocus.dll) Version: 2024.9.26
Syntax public string ImageFolder { get; set; }
Public Property ImageFolder As String
Get
Set
Property Value
StringRemarks
Notice: The folder must exist. The component can't and will not create this folder.
The path must be an absolute and starts from a drive letter: "C:\.." or "D:\" etc.
Default value: The parent directory of the output HTML document when you are working with files or "String.Empty" when you are working using memory.
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