Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个设置为 612px 792px 的 html 布局,它应该呈现为 8.5 x 11 字母大小的页面。
但是,当我渲染时,我想出了一些小于字母大小的东西。
有任何想法吗?
wkhtmltopdf的默认页面大小默认为A4。
将其添加到您的渲染调用中:
render :pdf => 'my_file.pdf', :page_size => 'Letter'
或者,将其添加到 config/initializers/wicked_pdf.rb 中,如下所示:
WickedPdf.config = { :page_size => 'Letter' }
用于应用程序范围的更改。