Jspdf: Feature Request: Disable embedding of default fonts in output PDFs

Created on 7 Feb 2019  路  9Comments  路  Source: MrRio/jsPDF

Feature Request

Prevent default font list from being embedded in output PDFs. The default fonts included with jsPDF are great and helpful, however, in PRODUCTION I only want to embed the fonts that are required by the contents of the generated PDF. My final purpose for these PDFs is for printing purposes and it would be ideal to not embed additional fonts just because they are default within jsPDF.

If there is already a way to do this then I apologize for the feature request. I tried asking on SO on a way to do this but have not received any responses. I saw nothing in the docs either, so...

Extend Documentation Feature Request

All 9 comments

Yeah I didn't document it. I don't know if it is in the latest release.

var doc = new jsPDF({ putOnlyUsedFonts:true});
doc.setFont('helvetica', 'normal')
doc.text('only helvetica')
doc.save('onlyHelvetica.pdf')

Yeah I didn't document it. I don't know if it is in the latest release.

var doc = new jsPDF({ putOnlyUsedFonts:true});
doc.setFont('helvetica', 'normal')
doc.text('only helvetica')
doc.save('onlyHelvetica.pdf')

Thanks for the reply @arasabbasi. It does not appear to be in the latest (1.5.3). Glad to know it is coming though. Is this something that would rollout in the next minor release?

I think so.

Done with #2342

Hallo,
Im using last release v1.5.3
using _putOnlyUsedFonts:true_ does not make any effect . the size of the generated file and the number of the used fonts are the same.

@Fadiabb
Yes, it is not in 1.5.3 as @jaspervalero mentioned. And I mentioned, that I dont know if it is already in the current release. So yes, if you test it again in 1.5.3 than you will obviously come to the same conclusion that it is not implemented yet in 1.5.3 and you have to wait for 1.5.4 to get this option.

Logic.

@arasabbasi a quick code inspection shows that code for the option putOnlyUsedFonts as been added early December before the 1.5.3 release. So another explanation for the behaviour would be that the code is not working as expected or as documented.

@bernhardreiter

You are right!

fixed with #2381

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mellisa0109 picture mellisa0109  路  3Comments

Pinank picture Pinank  路  3Comments

allenksun picture allenksun  路  3Comments

sayo96 picture sayo96  路  3Comments

yankeeBrit picture yankeeBrit  路  3Comments