Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"showoff pdf" fails to load images #939

Open
silug opened this issue Jun 12, 2023 · 0 comments
Open

"showoff pdf" fails to load images #939

silug opened this issue Jun 12, 2023 · 0 comments
Labels

Comments

@silug
Copy link

silug commented Jun 12, 2023

Describe the Bug

showoff pdf fails with the following error:

Exit with code 1 due to network error: ProtocolUnknownError

A PDF is created with no images.

Expected Behavior

PDF should include images.

Steps to Reproduce

Steps to reproduce the behavior:

  1. 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 wkhtmltopdf/wkhtmltopdf#2660 (comment), 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.

@silug silug added the bug label Jun 12, 2023
@silug silug changed the title "showoff pdf" fails "showoff pdf" fails to load images Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant