Skip to content

Latest commit

 

History

History
executable file
·
56 lines (39 loc) · 2.06 KB

File metadata and controls

executable file
·
56 lines (39 loc) · 2.06 KB

restruct/docsys-tools

Umbrella package that bundles all DocSys CLI tool wrappers and defines system tool paths.

Sub-packages (bundled tools)

Package Constant Tool
restruct/cpdf-static CPDF_PATH Coherent PDF v2.8.1 (macOS + Linux, x64 + ARM)
restruct/wkhtmltopdf-static WKHTMLTOPDF_PATH wkhtmltopdf 0.12.6 with patched Qt + Docker
restruct/xpdf-static XPDF_BIN_DIR xpdf tools (pdftotext, pdfinfo, pdftopng, etc.)
restruct/dot-static GRAPHVIZ_DOT_PATH Graphviz dot (static Linux binary + Homebrew)

Each sub-package has its own bootstrap and PHP wrapper classes.

System tool paths (this package)

This package's bootstrap.php defines paths for tools that must be installed on the system:

Constant Tool Install
GS_PATH Ghostscript apt install ghostscript
CONVERT_PATH ImageMagick/GraphicsMagick apt install graphicsmagick-imagemagick-compat
SOFFICE_PATH LibreOffice headless apt install libreoffice-nogui

Usage

Each sub-package auto-initializes via its own bootstrap. To also define system tool paths:

require_once 'vendor/restruct/docsys-tools/bootstrap.php';

Or override via environment variables:

GS_PATH=/usr/bin/gs
CONVERT_PATH=/usr/bin/convert
SOFFICE_PATH=/usr/bin/soffice

Migration from v0.x

The monolithic DocSysTools::init_paths() / DocSysTools::init() API is removed. Each sub-package now handles its own binary resolution independently.

Constant changes:

  • XPDF_BIN_PATHXPDF_BIN_DIR (from restruct/xpdf-static)
  • PDFINFO_PATH → use Restruct\Xpdf\Xpdf::getToolPath('pdfinfo')
  • PDFTOPNG_PATH → use Restruct\Xpdf\Xpdf::getToolPath('pdftopng')
  • GRAPHVIZ_DOT_PATH → still GRAPHVIZ_DOT_PATH (from restruct/dot-static)
  • DOT_PATH → removed, use GRAPHVIZ_DOT_PATH

System tool installation

See previous README for detailed installation instructions for wkhtmltopdf, convert, gs, and soffice.