Ruby on rails 如何在pdfkit、rb(pdfkit gem)中动态设置pdf页面宽度

Ruby on rails 如何在pdfkit、rb(pdfkit gem)中动态设置pdf页面宽度,ruby-on-rails,ruby,pdfkit,Ruby On Rails,Ruby,Pdfkit,如何动态覆盖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 recor

如何动态覆盖
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
  }
或者有没有设置最小页面宽度和最大页面宽度的方法?

使用参数创建实例:

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