2

I'm generating a PDF from a template using the Printmaker plugin. My CSS is being picked up and rendered mostly correctly and if the template is rendered to screen as HTML then the fonts work. However I can't get the fonts to work with the PDF generation.

Does anyone know what I need to do to get the font information embedded within the PDF?

2 Answers 2

4
  • Make sure your fonts are TTF.
  • If you're loading them by remote URL, make sure the isRemoteEnabled is set to true.
  • If you're changing weights, make sure to use the named weights in your CSS (normal, bold) rather than numeric weights.

(These are limitations of the underlying DOMPDF library, which is used in Printmaker 1.x. The next release of Printmaker, for Craft 3, uses a much nicer rendering engine, which will eliminate these limitations.)

1
  • My particular issue was down to the paths but the weights and isRemoteEnabled are top tips so I'll mark this as the answer.
    – foamcow
    Commented Feb 23, 2018 at 18:24
1

Seemed to be a matter of requiring the full URL to the font file and removal of any weight declarations in the CSS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.