FILEHTMLLOADOPTIONS

typedef struct _FILEHTMLLOADOPTIONS 
{ 
   L_UINT uStructSize; 
   L_CHAR szDomainWhitelist[FILEHTMLLOADOPTIONS_DOMAINWHITELISTSIZE]; 
   L_BOOL bEnableJS; 
   L_HTMLENGINE HtmlEngine; 
} FILEHTMLLOADOPTIONS, *pFILEHTMLLOADOPTIONS; 

The FILEHTMLLOADOPTIONS structure provides information for loading HTML files.

Members

uStructSize

Size of this structure in bytes, for versioning. Use the sizeof() operator to calculate this value.

szDomainWhitelist

List of domains to allow when parsing links in the input HTML file. Any external links that are encountered will be ignored if the domains are not included in szDomainWhitelist.

bEnableJS

Flag indicating whether to enable or disable running JavaScript resources embedded in the HTML files during the rendering process. Possible values are:

Value Meaning
TRUE Enable JavaScript effects.
FALSE Disable JavaScript effects.

HtmlEngine

The HTML engine to use when rendering HTML files.

Comments

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() operator to calculate this value. Functions that do not require the structure to be initialized will take the total size of the structure, in bytes, as an additional function parameter.

The FILEHTMLLOADOPTIONS structure is used by the following functions:

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

LEADTOOLS Raster Imaging C API Help