# Avoid HTML Export error in 11.2?

**URL:** <https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502>\
**Category:** Questions\
**Tags:** mathematica, import-and-export\
**Created:** [November 10, 2017, 11:31pm UTC](https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502 "2017-11-10T23:31:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajv](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajv](https://community.wolfram.com/u/ajv)\
**Post date:** [November 10, 2017, 11:31pm UTC](https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502/1 "2017-11-10T23:31:44Z")

</div>

The following piece of code worked fine in Mathematica 11.1:

```
notesgrid = Text[Grid[{{ Hyperlink["pdf link 1", "notes-1.pdf"]}}]]
Export[FileNameJoin[{NotebookDirectory[], "notes.html"}], notesgrid];

```

But in 11.2 it fails to produce the hyperlink in the html source code (it doesn’t create the tags), though the link does appear in the Mathematica output cell.

Is this a known problem? Is there a workaround (other than going back to 11.1)?

---

<div class="post-metadata">

**Author:** ![lehinp](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/lehinp/32/8056_2.png) [@lehinp](https://community.wolfram.com/u/lehinp)\
**Post date:** [November 12, 2017, 5:36am UTC](https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502/2 "2017-11-12T05:36:39Z")

</div>

I confirm that with _Mathematica_ 11.2.0 on Windows 7 x64 the text `"pdf link 1"` in the exported web page is converted to a GIF image which isn’t a hyperlink. I recommend reporting this to the tech support as a bug. The expected behavior is to get the exported `Hyperlink` as a hyperlinked text, not as an image of text.

---

<div class="post-metadata">

**Author:** ![lehinp](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/lehinp/32/8056_2.png) [@lehinp](https://community.wolfram.com/u/lehinp)\
**Post date:** [November 12, 2017, 5:51am UTC](https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502/3 "2017-11-12T05:51:15Z")

</div>

A related bug:

- [How do I export a hyperlink?](https://mathematica.stackexchange.com/q/158752/280)

Unfortunately the workaround suggested in that thread doesn’t work in this case.

It is also worth to note that exporting such a little expression takes a lot of time on my machine: about 10 seconds, what isn’t appropriate.

---

<div class="post-metadata">

**Author:** ![carlob](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/carlob/32/5986_2.png) [@carlob](https://community.wolfram.com/u/carlob)\
**Post date:** [November 13, 2017, 8:11pm UTC](https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502/4 "2017-11-13T20:11:54Z")

</div>

A little known trick is to use the same HTML exporter that the cloud uses:

```
notesgrid = Grid[{{Hyperlink["pdf link 1", "notes-1.pdf"]}}];
Export[FileNameJoin[{NotebookDirectory[], "notes.html"}], notesgrid, "HTMLFragment", "FullDocument" -> True]

```

I removed Text because it’s not yet supported, and stuff is styled as Text by default by this exporter anyway.

---

<div class="post-metadata">

**Author:** ![ajv](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajv](https://community.wolfram.com/u/ajv)\
**Post date:** [November 14, 2017, 3:04am UTC](https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502/5 "2017-11-14T03:04:10Z")

</div>

Carlo, thanks for the tip/trick but what I need are: 1) the image that Export creates and 2) the html code ( tags, etc) so that I can use them to build my website (I create a large table that has pdf links).

As Alexey suggests, I think I will report this as a bug and just do this exporting in 11.1 until it gets fixed.

---

<div class="post-metadata">

**Author:** ![carlob](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/carlob/32/5986_2.png) [@carlob](https://community.wolfram.com/u/carlob)\
**Post date:** [November 14, 2017, 8:37am UTC](https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502/6 "2017-11-14T08:37:46Z")

</div>

I’m not sure I understand why you want to transform text into an image, but if you want to do that you can always explicitly call Rasterize before exporting.

---

<div class="post-metadata">

**Author:** ![ajv](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajv](https://community.wolfram.com/u/ajv)\
**Post date:** [November 14, 2017, 2:18pm UTC](https://community.wolfram.com/t/avoid-html-export-error-in-11-2/11502/7 "2017-11-14T14:18:39Z")

</div>

I use Mathematica to create a set of Grade 10 math notes that go on my website. I use Grid (and Text) to create a formatted table that provides the links to the PDFs (100+ topics). You can see the result here [1](http://ajv.me/hth-2017-18/help/math-2-notes/).

Prior to 11.2, the Export function did the job just fine: it created an image and produced the HTML code, which were easy to add to my website.

If there is an alternative way of doing this and getting the formatting to be similar, I’d be interested in pointers on how to do it.

Thanks, Andrew.
