#include "l_bitmap.h"
L_LTFIL_API L_INT L_SetHtmlLoadOptions(pOptions)
Sets the file options used by LEADTOOLS for loading HTML files.
Pointer to the FILEHTMLLOADOPTIONS structure that contains the options to be used for loading HTML files.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The FILEHTMLLOADOPTIONS.uStructSize member must be set before calling this function.
The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.
Required DLLs and Libraries
Win32, x64, Linux.
static L_INT HtmlOptionsExample()
{
// HTML file
L_TCHAR* htmlFileName = MAKE_IMAGE_PATH(TEXT("file.html"));
// Set the HTML options to only allow loading resources from the leadtools.com domain.
// First, get the current options
FILEHTMLLOADOPTIONS htmlOptions;
L_INT nRet = L_GetHtmlLoadOptions(&htmlOptions, sizeof(htmlOptions));
if (nRet != SUCCESS)
return nRet;
// Modify it
wcscpy_s(htmlOptions.szDomainWhitelist, TEXT("leadtools.com"));
// Set them
nRet = L_SetHtmlLoadOptions(&htmlOptions);
if (nRet != SUCCESS)
return nRet;
// Load the first page from the HTML file
BITMAPHANDLE bitmapHandle;
nRet = L_LoadBitmap(htmlFileName, &bitmapHandle, sizeof(bitmapHandle), 0, ORDER_BGRORGRAY, NULL, NULL);
// Do something with the bitmap
// Free it
if (bitmapHandle.Flags.Allocated)
L_FreeBitmap(&bitmapHandle);
return nRet;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document