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

.ttf fonts not working with compressed pdf on Safari browser. #2955

Closed
cbermudezroda opened this issue Oct 10, 2020 · 1 comment
Closed

.ttf fonts not working with compressed pdf on Safari browser. #2955

cbermudezroda opened this issue Oct 10, 2020 · 1 comment

Comments

@cbermudezroda
Copy link

Hey everyone!
I'm using the librery for a Angular proyect and it's works fantastic. However, I'm having a weird problem when I try to use embedded fonts and compressed pfd on Safari (only here). The result is a pdf with strange caracters :(
The strange thing is that if the pdf is not compressed, it's works good!

Here some stuffs to get context:

  • Installed jsPDF by npm
  • Angular 8
  • Code use:
import jsPDF from 'jspdf';
import RobotoRegularFont from '../../../assets/fonts/Roboto/Roboto-Regular.ttf';
... // other code 
generateAndDownloadPDF() {
   const doc = new jsPDF('p', 'mm', 'a4', true);
   doc.addFont(RobotoRegularFont, 'Roboto', 'normal');
   // other code
   doc.setFont('Roboto');
   // other code
  doc.save('export.pdf');
}

Before using this code I tryed with the exaple on the README.md but had the same problem.
The fonts works for all browsers and differents SO in compress mode except Safari.
Any thought what can be happening?

Thanks :)

@HackbrettXXX
Copy link
Collaborator

HackbrettXXX commented Oct 12, 2020

Thanks for the report. There is already a fix under way: #2944.

Duplicate of #2743

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