Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Hyperlinks

Jump to bottom
Olivier Nizet edited this page Jan 18, 2026 * 5 revisions

External Links

Only absolute or relative Uri are processed. Javascript link are ignored.

These URI are valid

Anchors

Anchors are supported and you can turn off this option (enabled by default). Anchoring is link to a section within the document.

converter.SupportsAnchorLinks = false;

Anchoring top of the document

There is a predefined anchor inside Word that refers to the top of the document : #_top. This anchor is always respected despite the status of SupportsAnchorLinks. For user convenience, we also support the anchor #top as an alias.

If the top anchor is missing in the Word document, it will be automatically created in the 1st paragraph of the body.

<h1>Table of Contentsh1>
<ul>
<li><a href="#anchor1">Heading 1a>li>
<li><a href="#anchor2">Heading 2a>li>
ul>

<h1 id="anchor1">Heading 1h1>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dictum leo quis ipsum tempor nec ultrices sapien elementum.

<h1 id="anchor2">Heading 2h1>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dictum leo quis ipsum tempor nec ultrices sapien elementum.

<div style="text-align: right">
<li><a href="#_top">Back to ToCa>li>
div>

Embed an image inside an anchor

Image can be clickable and redirecting to a link or anchor.

<a href="https://github.com/onizet/html2openxml">HtmlToOpenXmla>
<br><br>
<a href="http://www.wikipedia.org">
<img alt="Wikipedia, the Free Encyclopedia" src="wikipedia.png" />
a>

Bookmark

Bookmarks are section in the OpenXml document that you can link to (things like Table of Content for instance). When the parser meet internal anchors, it will use bookmarks behind the scene. If for any reason you want to register a bookmark for a specific content (like Heading), you can define the bookmark with this attribute: data-bookmark.

<h1 data-bookmark="anchor1">Heading 1.1h1>

Clone this wiki locally