boazsegev / combine_pdf

A Pure ruby library to merge PDF files, number pages and maybe more...
MIT License
734 stars 156 forks source link

Latin chars stamp_pages not working #153

Closed RBN1993 closed 5 years ago

RBN1993 commented 5 years ago

Hi everyone, I tried to print this string 'Campaña ' or this other 'Pío' and i obtain this 'Campaˆ–a' and 'Pˆ›o' with stamp_pages() . How can i fix this problem?. Thak you.

boazsegev commented 5 years ago

Hi @RBN1993 ,

Thank you for opening this issue.

This is a known limitation of the PDF standard, nothing I can do about it in CombinePDF - PDFs only support ASCI text, as mentioned in the documentation.

The best approach to using UTF-8 / latin fonts, is to import a font from an existing PDF using the PDF#fonts method.

There's a discussion about it in this issue.

Good luck. Bo.

P.S.

If you feel that the documentation wasn't clear about this or that the information wasn't repeated enough in the right places, please submit a PR.

Thanks! B.