openhtmltopdf icon indicating copy to clipboard operation
openhtmltopdf copied to clipboard

SAX XMLReader error: The entity "ouml" was referenced, but not declared.

Open deepzeafish opened this issue 3 years ago • 1 comments

I have lots of German umlauts in my html file like this:

<p>Zw&ouml;lf Boxk&auml;mpfer</p>

Trying to convert that file to PDF like mentioned here: https://github.com/danfickle/openhtmltopdf/wiki/Integration-Guide#minimal-usage leads to an error: The entity "ouml" was referenced, but not declared.

Using the doctype clause mentioned here: https://github.com/danfickle/openhtmltopdf/wiki/Integration-Guide#character-entities gives me this error: DOCTYPE clause cannot have a non-null PUBLIC ID and a null SYSTEM ID

Any ideas?

Thanks

deepzeafish avatar Aug 19 '21 15:08 deepzeafish

hi @deepzeafish , frankly, the simplest way is to use a html5 parser: https://github.com/danfickle/openhtmltopdf/wiki/Integration-Guide#html5-parser-support .

It will do the entity conversion for you without fiddling with DTD & co :)

syjer avatar Aug 23 '21 15:08 syjer