Open silug opened 1 year ago
showoff pdf fails with the following error:
showoff pdf
Exit with code 1 due to network error: ProtocolUnknownError
A PDF is created with no images.
PDF should include images.
Steps to reproduce the behavior:
showoff (0.20.4)
pdfkit (0.8.7.3)
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
wkhtmltopdf 0.12.6
Based on https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2660#issuecomment-663063752, I made the following modification:
--- showoff-0.20.4/lib/showoff_utils.rb.orig 2023-06-12 14:18:03.602606733 -0500 +++ showoff-0.20.4/lib/showoff_utils.rb 2023-06-12 14:18:08.807586825 -0500 @@ -570,7 +570,7 @@ end def self.showoff_pdf_options(dir = '.') - opts = get_config_option(dir, 'pdf_options', {:page_size => 'Letter', :orientation => 'Landscape', :print_media_type => true}) + opts = get_config_option(dir, 'pdf_options', {:page_size => 'Letter', :orientation => 'Landscape', :print_media_type => true, :enable_local_file_access => true}) Hash[opts.map {|k, v| [k.to_sym, v]}] # keys must be symbols end
This seems to fix image loading.
Describe the Bug
showoff pdf
fails with the following error:A PDF is created with no images.
Expected Behavior
PDF should include images.
Steps to Reproduce
Steps to reproduce the behavior:
showoff pdf
Environment
showoff (0.20.4)
pdfkit (0.8.7.3)
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
wkhtmltopdf 0.12.6
Additional Context
Based on https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2660#issuecomment-663063752, I made the following modification:
This seems to fix image loading.