Skip to content

Ghostscript Install EN

zipax-bot edited this page Aug 11, 2026 · 1 revision

Ghostscript One-click Install

PDF compression depends on the external program Ghostscript (gs). When zipax detects that Ghostscript is missing, it shows a global install banner at the top of the result list (introduced in v0.25.4, inline card in v0.25.5, global banner since v0.25.6 per the design spec).

Why Ghostscript?

  • The image crate cannot compress PDFs directly; zipax shells out to Ghostscript for PDF re-compression
  • PDF compression therefore requires a system-level Ghostscript install

Per-Platform Install

Platform Method Notes
macOS Homebrew brew install ghostscript Executed automatically by the install command
Windows Official installer, silent install exe /S no UI
Linux Package manager dependency deb depends on ghostscript, handled by apt

Note: Linux deb/rpm packages declare the ghostscript dependency in bundle.linux (tauri.conf.json), so apt install handles it automatically.

Frontend Interaction (v0.25.6+)

  • When PDF compression fails because Ghostscript is missing, a single global banner appears at the top of the result list (multiple failed PDFs still show only one banner):
    • State machine: idle → installing → installed → failed
    • "Install" button → invokes the installGhostscript() Tauri command
    • Spinner + status text while installing
    • 800ms after success, all affected items are retried automatically
    • On failure, the full error message (including manual install commands) is shown with a retry button
  • All banner copy is i18n-ed (home.gs* keys)
  • Visual spec follows the software-update prompt pattern (.update-prompt)

Design spec: docs/design-spec-pdf-ghostscript-ux.md

Related Code

Location File
Rust backend zipax-cross/src-tauri/src/gs_install.rs
Command registration zipax-cross/src-tauri/src/lib.rs
Frontend binding zipax-cross/src/lib/tauri.ts
Global banner UI zipax-cross/src/components/ManualCompressionParts.tsx
PRD docs/prd-ghostscript-install.md

Back to Home-EN · 中文版:Ghostscript 一键安装

Clone this wiki locally