You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using an added unicode font in SVG results in broken PDF. There are no warnings or errors logged in the console.
On Windows, Sumatra displays a blank page, Adobe Reader says "There as an error processing a page. There as a problem reading this document (135)".
On macOS Big Sur 11.5.2, "Preview" displays a blank page.
However, the PDF renders correctly with anything Poppler-based on Linux or with PDF readers built into Firefox or Chrome browsers.
Various PDF tools report problems with the file. E.g.
pdfunite : "Syntax Error: Dictionary key must be a name object"
mutool : "error: invalid key in dict"
gs -sDEVICE=pdfwrite : "Error: obj definition followed by multiple tokens"
etc.
The UMD "LiberationSans-Bold-bold.js" (LiberationSans-Bold-bold.js.zip attached) was generated with jsPDF fontconverter tool from a TTF coming with default Xubuntu installation. The behaviour is the same with Free Sans, or Noto Sans fonts.
The behaviour is the same with SVG units changed to px.
If an additional font is not loaded, or when using default fonts, the PDF renders just fine.
Using the same font file to generate a PDF using jsPDF, but without SVG/svg2pdf stage, works ok.
it also creates an invalid PDF. Please move this issue to jsPDF. There have been similar issues with some fonts in the past. A workaround might be to use a different font.
it also creates an invalid PDF. Please move this issue to jsPDF. There have been similar issues with some fonts in the past. A workaround might be to use a different font.
Thanks!
All apologies for raising it in a wrong channel.
New issue opened with jsPDF: parallax/jsPDF#3245
Description
Using an added unicode font in SVG results in broken PDF. There are no warnings or errors logged in the console.
On Windows, Sumatra displays a blank page, Adobe Reader says "There as an error processing a page. There as a problem reading this document (135)".
On macOS Big Sur 11.5.2, "Preview" displays a blank page.
However, the PDF renders correctly with anything Poppler-based on Linux or with PDF readers built into Firefox or Chrome browsers.
Various PDF tools report problems with the file. E.g.
pdfunite : "Syntax Error: Dictionary key must be a name object"
mutool : "error: invalid key in dict"
gs -sDEVICE=pdfwrite : "Error: obj definition followed by multiple tokens"
etc.
Versions used:
jspdf.umd.js : 2.3.1
svg2pdf.umd.js : 2.1.0
To reproduce
HTML
asypdf.js
The UMD "LiberationSans-Bold-bold.js" (LiberationSans-Bold-bold.js.zip attached) was generated with jsPDF fontconverter tool from a TTF coming with default Xubuntu installation. The behaviour is the same with Free Sans, or Noto Sans fonts.
The behaviour is the same with SVG units changed to px.
If an additional font is not loaded, or when using default fonts, the PDF renders just fine.
Using the same font file to generate a PDF using jsPDF, but without SVG/svg2pdf stage, works ok.
Platform
The text was updated successfully, but these errors were encountered: