L_SetHtmlLoadOptions

#include "l_bitmap.h"

L_LTFIL_API L_INT L_SetHtmlLoadOptions(pOptions)

Sets the file options used by LEADTOOLS for loading HTML files.

Parameters

pFILEHTMLLOADOPTIONS pOptions

Pointer to the FILEHTMLLOADOPTIONS structure that contains the options to be used for loading HTML files.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

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

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

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 Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help