In my Rails 5 app I use wicked_pdf and wkhtmltopdf-binary gem for generating PDF from HTML. But there is some problem while generating PDF on production. Currency symbol is not displaying properly, but it's working fine in development.
Here is my PDF image.
My Gemfile looks like this:
gem 'wicked_pdf', '~> 1.1'
gem 'wkhtmltopdf-binary', '~> 0.12.3.1'
My Controller code:
def generate_order
@order = @user_builder.orders.find(params[:id])
render pdf: 'billing_pdf',
layout: 'layouts/pdf.html.erb',
:show_as_html => params[:debug].present?, #true
encoding: 'utf8'
end
I tried lots of solutions from Stackoverflow to other similar questions. They all suggested me to add meta in layout file. I also added it in my layout file.
edited
my PDF layout file.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Billing</title>
</head>
<body>
<div class='container'>
<%= yield %>
</div>
</body>
</html>
I will be really grateful if someone could point out what is going wrong in this case. Thanks in advance.