In my generated pdf I get this
0,00 €
instead of
0,00 €
Application.html.erb
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
show.html.erb
<%=number_to_currency item.total%>
In my generated pdf I get this
0,00 €
instead of
0,00 €
Application.html.erb
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
show.html.erb
<%=number_to_currency item.total%>
respond_to do |format|
format.html { render template: 'invoices/show' }
format.pdf do
render pdf: 'invoices/show',
template: 'invoices/show',
formats: :HTML,
encoding: 'utf8'
end
end
Still i can see the special characters in the PDF. Below is my code
pdf = WickedPdf.new.pdf_from_string(page_html,:page_size => "A3")
send_data(pdf,
:filename => "my_pdf_name.pdf",
:formats => 'HTML',
:encoding => 'utf8',
:disposition => 'attachment')
end
config/initializers/wicked_pdf.rb
WickedPdf.config = {
encoding: 'utf8'
}
© 2022 - 2024 — McMap. All rights reserved.
encoding: 'utf8'
into your initializers\wicked_pdf config file – Volney