My requirement is I am generating PDF out of the pre-rendered HTML template. This template is a multi-lingual page and uses custom fonts from our clients.
Following approaches tried:
I used
wicked_pdf(internally useswkhtmltopdf-binary) gem to achieve this, but the issues I face are: font kerning arent proper as every other character get overlapped on other. The same font appears proper on actual PDF. I included all CSSes directly into the HEAD -> STYLE, tried various tricks by setting letter-spacing, etc. but nothing worked.So, now using
flying_ruby_saucer. Font kerning looks proper. But neither characters from Arabic OR HINDI is printed on PDF nor custom font is picked up. I have declared custom font as:@font-face { font-family: 'My Font'; src: url('http://localhost:3000/assets/MyFont.ttf'); } body{ font-family:"My Font"; }
But this doesnot work either as PDF generated shows default font family. Non-ascii characters arent printed too.
Could anyone please help me fixing this (include foreign characters as well as include custom fonts)?
Thanks.