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

The source 'open_sans_bold_0e7196744e416eea97ecd5b9781a44c2" contains a bad /Bbox box #3559

Open
astilee opened this issue Nov 26, 2024 · 5 comments
Labels

Comments

@astilee
Copy link

astilee commented Nov 26, 2024

I am getting a error in production environment as

"The source
'open_sans_bold_0e7196744e416eea97ecd5b9781a44c2" contains
a bad /Bbox box"

But in my local and testing environment it works fine.

@bsweeney
Copy link
Member

bsweeney commented Nov 26, 2024

Is that from your PDF reader? How do you deploy to the production environment?

You might try removing the installed-fonts.json file and any non-bundled fonts from Dompdf's font directory.

@astilee
Copy link
Author

astilee commented Nov 27, 2024

When I open the PDF in Adobe Reader, I encounter this error. However, when viewing the PDF in a browser, the Open Sans fonts are not displayed correctly.

I am using Dompdf version 2.0.4. Where can I locate the installed_fonts.json file?

@bsweeney
Copy link
Member

As mentioned, the installed-fonts.json file is in the Dompdf font directory, dompdf/lib/fonts by default. Be sure to only delete the generated file, the one that does not contain ".dist" in it.

You might try upgrading to Dompdf 3.0.0, since it uses the latest version of FontLib which includes some font parsing improvements. Or, at least, make sure you're using the latest version compatible with 2.0.4 (FontLib 0.5.6).

Also, if you're able you can provide a sample of your PDF and we'll take a look to see if there's something structurally wrong with the file.

@astilee
Copy link
Author

astilee commented Dec 4, 2024

I just changed the font family used in my html from open-sans to DejaVu Sans and its working fine.
Now the issue i am facing is that when using png images in html, generation is getting error, only jpg images are getting loaded.

@bsweeney
Copy link
Member

bsweeney commented Dec 4, 2024

The DejaVu fonts come pre-installed so typically work more seamlessly across environments. This does point to a potential issue with how you deploy to your live server (e.g. by copying files) or with the configuration in that environment.

PNG images usually require extra processing, which would be handled primarily by the GD extension. Or if you have the IMagick extension installed that would be used. What is the error you receive?

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

No branches or pull requests

2 participants