gutschilla / elixir-pdf-generator

Create PDFs with wkhtmltopdf or puppeteer/chromium from Elixir.
MIT License
335 stars 71 forks source link

docs seem wrong for using chrome #70

Open jdewar opened 4 years ago

jdewar commented 4 years ago

rather than deal with wkhtmltopdf and flexbox, i've moved to chrome. the docs suggest this for using chrome-headless

config :pdf_generator,
    use_chrome: true,                           # <-- make sure you installed node/puppeteer
    prefer_system_executable: true              # <-- set this if you installed the NPM dependencies globally
    raise_on_missing_wkhtmltopdf_binary: false, # <-- so the app won't complain about a missing wkhtmltopdf

as best as i can tell, use_chrome: true doesn't work, and prefer_system_executable: true doesn't work in config.exs

i believe that config only works here, and like this:

|> PdfGenerator.generate_binary(
  generator: :chrome,
  prefer_system_executable: true
)