-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
Hi there,
I have an issue: PDF generation stopped working. I see many processes related to chromium and node.
Do you have any recommendations on what I can do?
def pdf(input_html)
Grover.new(input_html, **{
landscape: options[:page_orientation].to_sym == :landscape,
format: options[:page_format].to_sym,
prefer_css_page_size: true,
emulate_media: "screen",
wait_until: [ "domcontentloaded", "networkidle0" ],
launch_args: [ "--font-render-hinting=full", "--disable-setuid-sandbox", "--disable-gpu" ],
cache: false,
# timeout: 0,
# launch_args: ['--font-render-hinting=medium', '--no-sandbox'],
print_background: true,
scale: options[:zoom_level],
display_header_footer: true,
footer_template: hide_page_numbers? ? nil : footer_template,
margin: {
top: "0.2in",
right: "0.2in",
bottom: hide_page_numbers? ? "0.2in" : "0.45in",
left: "0.2in"
},
# debug: {
# headless: false, # Default true. When set to false, the Chromium browser will be displayed
# devtools: true # Default false. When set to true, the browser devtools will be displayed.
# },
timeout: 20_000,
convert_timeout: 20_000,
viewport: {
width: 1920,
height: 1920
}
}.compact_blank).to_pdf
endand config
Grover.configure do |config|
config.options = {
# format: 'A4',
# margin: {
# top: '0px',
# bottom: '0cm'
# },
user_agent: "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
viewport: {
width: 1080,
height: 1920
},
prefer_css_page_size: true,
emulate_media: "screen",
bypass_csp: true,
media_features: [ { name: "prefers-color-scheme", value: "dark" } ],
timezone: "America/New_York",
vision_deficiency: "deuteranopia",
extra_http_headers: { "Accept-Language": "en-US" },
enable_javascript: true,
geolocation: { latitude: 59.95, longitude: 30.31667 },
# launch_args: [ "--font-render-hinting=medium", "--disable-setuid-sandbox" ],
# focus: '#some-element',
# hover: '#another-element',
# debug: {
# headless: false, # Default true. When set to false, the Chromium browser will be displayed
# devtools: true # Default false. When set to true, the browser devtools will be displayed.
# },
cache: true,
timeout: 0, # Timeout in ms. A value of `0` means 'no timeout'
request_timeout: 20_000, # Timeout when fetching the content (overloads the `timeout` option)
convert_timeout: 20_000, # Timeout when converting the content (overloads the `timeout` option, only applies to PDF conversion)
launch_args: [ "--font-render-hinting=full", "--disable-gpu" ],
wait_until: [ "domcontentloaded", "networkidle0" ]
# ` debug: {
# headless: false, # Default true. When set to false, the Chromium browser will be displayed
# devtools: true # Default false. When set to true, the browser devtools will be displayed.
# }
}
end
Grover.configure do |config|
config.node_env_vars = { "LD_PRELOAD" => "" }
endMetadata
Metadata
Assignees
Labels
No labels