File Formats: Hypertext Markup Language (HTML)

Hypertext Markup Language (HTML) is the predominant markup language for web pages. It was created by the World Wide Web Consortium and WHATWG. It is used by the Chrome, Edge, Firefox, Internet Explorer, Opera and Safari browsers. For more information, refer to https://www.w3.org/.

The default extensions for this format are: .htm, .html, and .xhtml

Support for this file format can be unlocked using the following support constant: L_SUPPORT_DOCUMENT.

Use this format when you want to rasterize a file. If you want to write HTML, use the LEADTOOLS Document Writer SDK (API or .NET).

LEADTOOLS supports loading this format as either a raster image or as an SVG (Scalable Vector Graphics) document.

There are several engines available for loading this type of files:

  1. WebView2 (Windows-only, requires L_SUPPORT_RASTER_PDF_READ or L_SUPPORT_PDF_ADVANCED). This requires the Microsoft WebView2 engine, which comes preinstalled with Windows 10 and 11. It can also be installed from this Microsoft website link: Download the WebView2 Runtime.

  2. WebKit (Linux & Windows)

  3. Internet Explorer (IE) (Windows-only)

You can select the load engine and other HTML load options using the L_SetHtmlLoadOptions function.

Some HTML files take a long time to load because they contain links to web servers that take too long to respond. There are two ways of solving this type of problem:

  1. Abort loads/info requests that take too long using the heartbeat mechanism. See L_SetFilterHeartbeatCallback for more details.

  2. Specify a whitelist that restrict load requests only to the domains from the whitelist. Set the domain white list in FILEHTMLLOADOPTIONS.szDomainWhitelist and pass the FILEHTMLLOADOPTIONS structure to L_SetHtmlLoadOptions before calling the load/info function.

The following file constants are associated with this file format:

Constant Read Support Write Support Description
FILE_HTM Yes Yes [369] HTML File Format.

Required DLLs and Libraries

LEADTOOLS supports writing/saving using LEADTOOLS Document Writers. For additional support details, refer to the following:

Platforms

Win32, x64, Linux

See Also

FILEHTMLLOADOPTIONS

L_SetHtmlLoadOptions

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.