Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Euro sign shows as ? (question mark) #771

Closed
michel334 opened this issue Jan 25, 2014 · 1 comment
Closed

Euro sign shows as ? (question mark) #771

michel334 opened this issue Jan 25, 2014 · 1 comment

Comments

@michel334
Copy link

Is there an easy way to get euro sign to show instead of question mark?

i downloaded and installed the latest patch dompdf_0-6-0_beta3.tar.gz but no luck

i dont want to mess too much with my server settings, i also use other pdf systems on magento that show euro sign ok

update
i read this:
Q: How can I print the euro symbol?
A: You can print the euro symbol (€) using the following entity: €.
but how, which file??

update2
i read this

 * When set to true the PDF backend must be set to "CPDF" and fonts must be
 * loaded via load_font.php.
 *
 * When enabled, dompdf can support all Unicode glyphs.  Any glyphs used in a
 * document must be present in your fonts, however.
 */
def("DOMPDF_UNICODE_ENABLED", true);

fonts must be loaded via load_font.php.
But how do i do this. is it command line? do i need to edit load_font.php?
which line i need to change, which font can i use. i am really not getting it :)

update3
http://eclecticgeek.com/dompdf/load_font.php
but i get
Unable to locate the ttf2afm / ttf2pt1 executable.

update4
Create a compatible HTML document
For DOMPDF to correctly parse your document you must let it know what encoding is used. To do this place a meta tag in the head of your document

What document i need to create? the invoice pdf gets created from the database i think? or is there a template document i need to change with utf-8 header? do you mean the opencart index.php? its a mystery!
my girlfriend is complaining i spend hours on this screen and its saturday :) i not give up!

@bsweeney
Copy link
Member

Which version of dompdf are you using? For the Euro symbol you don't need a different font. The only thing you need to do is make sure the character and/or document is properly encoded.

dompdf 0.5.x only supports Windows ANSI encoding. To display the Euro symbol in a resulting PDF when using this release you should encode it as indicated. So in the HTML you feed to dompdf you need to ensure that any instance of the Euro symbol is encoded. For example:

<html>
<body>
  <p>The euro character: &#0128;</p>
</body>
</html>

dompdf 0.6.x and above support different encodings. So the easiest way to display the Euro is to encode your document in UTF-8. Then you can reference the Euro symbol in a few different way. For example:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
  <p>The euro character:  €  &#0128;  &euro;  &#8364;
</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants