Question marks in generated PDF

1,172 views
Skip to first unread message

MH

unread,
Nov 16, 2010, 7:00:11 AM11/16/10
to dompdf
Hi All,
I have an issue from version 6 release 326 to do with unicode
characters.

We have this working fine on one server but can't seem to get it
working on a new server. Any unicode characters are coming up as
question marks.

The test text in question is:

$output='
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<style type="text/css">
body
{
padding: 2cm 1cm 2cm 3cm;
}
</style>
</head>
<body>
*&#160;Hello&#160;x&nbsp;*
<p>Whether you would like a British Lop to breed and raise pedigree
piglets, or perhaps a Berkshire for delicious sausages, this book will
help you to pick the right pig for you.</p>
<p>Guiding you through every stage of the pig keeping process &#8211;
from choosing livestock to finding a partner for your sow &#8211; this
book covers everything you need to know about keeping, breeding,
eating and selling pigs.</p>

</body>
</html>';

The hello line works fine but the #8211 dashes are coming up as
question marks. I'm sure its either down to paths or something not
being installed but I can't figure out what. Does anyone have any
pointers?

We are seeing this on documents as a cap A on other documents instead
of the question mark.

UNICODE is enabled in the config. We are not using any special fonts
to recreate the issue.

Thanks

MH

unread,
Nov 16, 2010, 9:17:31 AM11/16/10
to dompdf
Found the issue and going to post the response so others can view.

There is a handy tool in ~/dompdf/www/setup.php

This checks the config and showed that mbstring was not installed/
enabled on the server.

Once this was available the entities and unicode equivalents convert
correctly.

Fabien Ménager

unread,
Nov 16, 2010, 10:49:41 AM11/16/10
to dompdf
It's good to see the tool I made finally helped someone ;)

AlexBG

unread,
Nov 18, 2010, 4:35:06 PM11/18/10
to dompdf
Hi,

I have downloaded 0-6-0_beta1 and there is no setup.php in dompdf/
www/.
I have the same problem with the unicode characters being seen as
question marks. As far as I can see from the phpinfo() mbstring is
enabled.
Actually when using the examples on your website, again there are
question marks in the pdf, instead of cyrillic symbols for example:

http://pxd.me/dompdf/dompdf.php?base_path=www%2Ftest%2F&options[Attachment]=0&input_file=encoding_utf-8.html#toolbar=0&view=FitH&statusbar=0&messages=0&navpanes=0

Can you help?
Thank you.

BrianS

unread,
Nov 18, 2010, 8:36:48 PM11/18/10
to dompdf
In order to support Cyrillic characters you will need to load one of
your own fonts. DOMPDF does not currently support Unicode for the
built-in fonts. It is something we're looking into, but I don't know
that it'll be ready for the next release.

To load a font you'll need to have access to the ttf2ufm binary.
Alternately you can try the web-based font prep tool (currently in
alpha).

MH

unread,
Nov 22, 2010, 8:46:41 AM11/22/10
to dompdf
Download the svn checkout instead. It will be more recent.
Reply all
Reply to author
Forward
0 new messages