如何在 pdfkit,rb 中动态设置 pdf 页面宽度 (pdfkit gem)

How to set pdf page-width dynamically in pdfkit,rb (pdfkit gem)

如何动态覆盖 pdfkit 配置

PDFKit.configure do |config|
  config.wkhtmltopdf = '/path/to/wkhtmltopdf'
  config.default_options = {
    :page_size => 'Legal',
    :print_media_type => true
:page_width=> " i just want to change this value depends on record count"====> issue
  }

或者有什么方法可以设置最小页面宽度和最大页面宽度?

https://github.com/pdfkit/pdfkit#usage

使用参数创建实例:

kit = PDFKit.new(html, page_width: '169.33')