-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Custom font with spaces in name causes invalid PDF #3000
Comments
I can confirm this scenario and that removing spaces fixes it. I came here looking for a solution and this provided it, relatively painlessly. Thanks @Ceremony64 |
Here, the |
I created a PR: #3018. @Ceremony64 could you verify that this fixes the issue? Note, that you need to run |
This still isn't working and I'm using version 2.3.1. Is it expected we use the new What's super weird is the PDF works fine if opened in Chromes' PDF viewer, but it does not work in any other browser nor on desktop like Mac Preview or Adobe. And when I punch in the file to the validator linked above by OP it also gives me the same error. |
When generating a PDF and a custom font title with a space in its name is used, the resulting PDF is not PDF/A compliant and even fails to open in some PDF readers (such as awful Adobe Acrobat Reader).
Here is a example with jsPDF v2.11 and the default windows fonts Calibri and Comic Sans. From my testing, any ttf font will do:
Using https://www.pdf-online.com/osa/validate.aspx to test the invalid PDF shows the following:
Simply removing the space, making it "ComicSans" instead, fixes this issue and neither the validator or Acrobat Reader will complain anymore.
It is probably related to issue #2593
The text was updated successfully, but these errors were encountered: