When I create a PDF file with text containing characters such as é è à, etc., I get funny characters instead.
I know this should be due to the encoding.
I tried force_encoding ("UTF-8") on a string with these characters without success.
joel
Add <meta charset="UTF-8">at the top of your HTML view or at the top of your layout.
<meta charset="UTF-8">
You can go as an option:
encoding: 'utf8'
wickedpdf
WickedPdf.new.pdf_from_string( render :pdf => "Paper", :template => "paper/paper.html", :page_size => 'A4', formats: :html, encoding: 'utf8', :margin => {:top => 40} )
, :
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
You can refer to this link - https://github.com/mileszs/wicked_pdf/issues/35 for more details.