unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.6k stars 253 forks source link

How to use UTF8 Font. #282

Closed riseres closed 4 years ago

riseres commented 4 years ago

I have try this library. and I want to use Thai Font. I have changed to Thaifont.tff file.

using model.NewPdfFontFromTTFFile(.....)

as follow in createPDF example. The result is blank Thai font.

let's me know how to use UTF font.

github-actions[bot] commented 4 years ago

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

adrg commented 4 years ago

Hi @riseres. Try using model.NewCompositePdfFontFromTTFFile instead of model.NewPdfFontFromTTFFile when loading your font.

riseres commented 4 years ago

Thank you.

It works