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

Trouble using the DejaVu font #698

Closed
progga opened this issue Aug 15, 2013 · 4 comments
Closed

Trouble using the DejaVu font #698

progga opened this issue Aug 15, 2013 · 4 comments

Comments

@progga
Copy link

progga commented Aug 15, 2013

Hi,
I am trying to prepare a simple PDF from an HTML file that uses the DejaVu font. But instead of the characters, I am only seeing boxes in the PDF :-( Any hint of what I might be doing wrong will be much appreciated.

Here is the HTML document:


<html>
<head>
<title>DejaVu font test</title>
</head>

<body>
<p style="font-family : DejaVu Sans, Helvetica, sans-serif;">ABC abc 123</p>
</body>
</html>


I have kept the resultant PDF online: http://codesetter.com/files/dejavu-font-test.pdf
I have also kept my copy of dompdf online in case it is of any use: http://codesetter.com/files/dompdf.tar.gz

The DejaVu font seem to be getting embedded in the PDF okay, but does not seem to have any effect :-(

I am not sure which version of Dompdf I am using as I cannot find the version number anywhere. But it supports font subsetting, so I guess it is at least 0.6 beta 3. I downloaded it from Github in May. PDF backend is CPDF and Unicode is enabled.

PHP version is 5.3.8 and operating system is OpenSuse 12.1. mb_string extension is enabled. To view the PDF, I am using the Acrobat reader from Windows 7. Interestingly, everything works fine when I do not set the font-family to DejaVu.

Thanks,
Adnan

@bsweeney
Copy link
Member

Right now I haven't a clue. I don't really see anything wrong with your HTML or your dompdf installation. And it renders as expected for me. Do you get any PHP errors or warnings? Have you tried it without subsetting enabled? Have you tried downloading a fresh copy of dompdf/php-font-lib? The PDF you uplaoded, was that direct output from dompdf or re-saved from Adobe Reader?

@progga
Copy link
Author

progga commented Aug 16, 2013

Hi,
Thanks for your prompt response :-) I downloaded the latest copies of dompdf and php-font-lib as per your suggestion. While testing these, I spotted the problem. I am calling "$dompdf->get_canvas()->get_cpdf()->setEncryption()" in the PHP code which according to https://groups.google.com/forum/#!topic/dompdf/a9gDaZ4OSTM and http://code.google.com/p/dompdf/issues/detail?id=334 is supposed to cause trouble with embedded fonts :-( Once I remoted that line of code, the PDF looks okay. So I guess I will have to leave without setEncryption(). If there is a better way then do let me know.

Sincerely,
Adnan

@bsweeney
Copy link
Member

That would be the problem. We haven't addressed the issue yet so if you need protection you either need to avoid embedded fonts or do some kind of post-processing (e.g. with pdftk). Sorry for the inconvenience. Visit issue #340 and click the "Watch Thread" button at the bottom of the page to get updates on the issue.

@progga
Copy link
Author

progga commented Aug 19, 2013

Thanks a lot for the tips about pdftk :-) I will keep an eye on issue #340

Sincerely,
Adnan

@progga progga closed this as completed Aug 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants