PDF Generator v0.5.3 PdfGenerator.PathAgent

Will check for system executables at startup time and store paths. If configured as such, will raise an error when no usable executable was found.

The idea is to perform this kind of auto-configuration at startup and then store the values in this agent. The same could probably be achieved with Application.put_env/3. Comments on this welcome. Until then, this just owrks.

Link to this section Summary

Functions

Returns path state as struct

Checks options for generator binaries (chrome-headless-render-pdf and wkhtmltopdf) exists on path. Raises an error if corresponding options are set to true

Stops agent, returns :ok

Link to this section Functions

Returns path state as struct

Link to this function

init_opts(paths_from_options)

Link to this function

raise_or_continue(options)

Checks options for generator binaries (chrome-headless-render-pdf and wkhtmltopdf) exists on path. Raises an error if corresponding options are set to true:

  • :raise_on_missing_wkhtmltopdf_binary
  • :raise_on_missing_chrome_binary
  • :raise_on_missing_binaries -> raises on eiter binary missing
Link to this function

start_link(path_options)

Stops agent, returns :ok