【问题标题】:How to set pdf page-width dynamically in pdfkit,rb (pdfkit gem)如何在 pdfkit,rb (pdfkit gem) 中动态设置 pdf 页面宽度
【发布时间】:2015-06-25 12:16:02
【问题描述】:

如何动态覆盖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
  }

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

【问题讨论】:

    标签: ruby-on-rails ruby pdfkit


    【解决方案1】:

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

    使用参数创建实例:

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

    【讨论】:

      猜你喜欢
      • 2011-12-24
      • 2018-11-22
      • 2019-02-03
      • 2021-05-05
      • 1970-01-01
      • 1970-01-01
      • 2021-11-17
      • 1970-01-01
      • 2017-10-08
      相关资源
      最近更新 更多