I am trying to generate PDF using
WIckedPdf version = 1.1.0
wkhtmltopdf 0.12.4 (with patched qt)
Rails 4.2
Below is my Controller endpoint
@cover = render_to_string layout: "application.html.erb", template: "pdf/cover.html.erb", locals: {report: @report}
@pdf = render_to_string pdf: "report",
encoding: "UTF-8",
page_size: 'A4',
layout: "pdf.html.erb",
orientation: 'Portrait',
disable_smart_shrinking: false,
disable_internal_links: false,
disable_external_links: false,
lowquality: false,
background: true,
no_background: false,
page_height: 297,
page_width: 210,
cover: @cover,
template: "pdf/report.pdf.erb",
locals: {report: @report},
show_as_html: false,
margin: {
bottom: 40,
top: 10
},
footer: {
html: {
template: 'pdf/footer.html.erb' # use :template OR :url
}
},
toc: {
text_size_shrink: 0.8,
header_text: "Table of Contents",
no_dots: false,
disable_dotted_lines: false,
disable_links: false,
disable_toc_links: false,
disable_back_links: false,
}
send_data @pdf, type: :pdf, disposition: 'inline'
Am facing the problem that All the text that are generated in pdf is very very SMALL. To achieve font size of 14 in pdf, i had to change my css as font-size: 56px (Four times than the normal pixel)
Can Anybody help me why font size is rendered like this? Also, All the css that includes pixels such as padding, margin are four times smaller than normal.
Even if changed CSS of my file to four times higher values, CURRENTLY I AM UNABLE TO CHANGE FONT_SIZE FOR TABLE OF CONTENTS GENERATED.
Any help / Reference would be highly helpful and appreciated