Qpdf.Installer (qpdf v0.1.0)

Copy Markdown View Source

Manages finding or downloading and extracting the qpdf AppImage.

Summary

Functions

Returns the expected path to the AppRun executable.

Returns the version of the installed qpdf executable.

Detects the current OS and CPU architecture.

Ensures that the qpdf executable is available. Returns the path to the executable, downloading and installing it if not present.

Finds the configured or existing qpdf executable without attempting to download.

Downloads and extracts the qpdf AppImage into priv/native or _build.

Returns the priv directory for the :qpdf application.

Returns the directory where the qpdf native files are stored. Uses _build/qpdf-<version> when running under Mix to keep priv/ in the source repository clean, and falls back to priv/native in releases.

Returns the base temporary directory.

Returns the configured qpdf version.

Functions

app_run_path(version \\ nil)

Returns the expected path to the AppRun executable.

bin_version()

@spec bin_version() :: {:ok, String.t()} | :error

Returns the version of the installed qpdf executable.

Returns {:ok, version_string} on success or :error when the executable is not available or cannot be run.

detect_target(os \\ nil, arch \\ nil)

Detects the current OS and CPU architecture.

ensure_executable!()

@spec ensure_executable!() :: String.t()

Ensures that the qpdf executable is available. Returns the path to the executable, downloading and installing it if not present.

find_executable()

@spec find_executable() :: {:ok, String.t()} | {:error, :not_found}

Finds the configured or existing qpdf executable without attempting to download.

install(opts \\ [])

@spec install(keyword()) :: {:ok, String.t()} | {:error, any()}

Downloads and extracts the qpdf AppImage into priv/native or _build.

priv_dir()

Returns the priv directory for the :qpdf application.

storage_dir(version \\ nil)

Returns the directory where the qpdf native files are stored. Uses _build/qpdf-<version> when running under Mix to keep priv/ in the source repository clean, and falls back to priv/native in releases.

tmp_dir()

Returns the base temporary directory.

version()

Returns the configured qpdf version.