我正在使用 Ruby 2.5.3p105 和 Rails 5.2.0 。和 gem 'wicked_pdf' 1.1.0 用于 pdf 下载。从下图中,悬停时我会在顶部看到栏,其中包括标题、页码、旋转、下载、打印等几项内容,最后一个是书签。我想从此工作表中删除书签。我怎样才能做到这一点?
我的代码是:
home_controller.rb:
pdf = render_to_string pdf: "#{@selected_scheme_code}.pdf",
template: "/home/overview_download.html.erb",
encoding: "UTF-8",
layout: 'pdf.html.erb',
disposition: "attachment",
title: "Fund Factsheet",
:page_size => "A4",
margin: {top: 0,
bottom: 0,
left: 0,
right: 0},
:javascript_delay => 5000,
save_to_file: save_path,
:extra => '--no-stop-slow-scripts',
save_only: true
File.open(save_path, "wb") do |file|
file << pdf
end