-2

I am using Ruby 2.5.3p105 and Rails 5.2.0 . And gem 'wicked_pdf' 1.1.0 for pdf download. From below picture, on hover I am getting bar in the top which include several things like title, page no, rotate, download, print, and last one is bookmarks. I want to remove bookmarks from this sheet. How can I achieve this?

enter image description here

My Codes are:

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
Priyank Dey
  • 1,104
  • 1
  • 19
  • 43
  • 1
    This has nothing to do with the pdf generated by your gem, it's just the PDF viewer that displays these options. – Tamer Shlash Mar 27 '19 at 12:45
  • But, title: "Fund Factsheet", is working which is included in my code. If I change the title in my code, the title will be changed. – Priyank Dey Mar 27 '19 at 12:53
  • If you don't want your PDF viewer to display a title bar, then you need to turn off the title bar in your PDF viewer. – Jörg W Mittag Mar 27 '19 at 15:56

1 Answers1

1

When you create pdf file, this file has title, content, ... You open this file with PDF viewer, title is showed and page no, download, print, bookmark button are PDF viewer options. So you can't remove bookmark button from this. :D

ttuan
  • 114
  • 4