I look in the documentation but cannot find the answer. How to specify the page size of my pdf document and what are the available page sizes? I keep looking and looking, but I cannot find good documentation. Give me the URL or let me know how I can encode any page size in a PDF.
Oh, and I don’t want to do this in any configuration file, because I need to create PDf documents of different sizes.
NOT in the configuration file ...
PDFKit.configure do |config|
config.wkhtmltopdf = `which wkhtmltopdf`.to_s.strip
config.default_options = {
:encoding=>"UTF-8",
:page_size=>"A4",
:margin_top=>"0.25in",
:margin_right=>"1in",
:margin_bottom=>"0.25in",
:margin_left=>"1in",
:disable_smart_shrinking=>false
}
end
source
share