PaperDiet is an open source macOS app for shrinking PDFs with a native SwiftUI interface and a bundled Ghostscript backend.
The easiest path for end users is a GitHub release build:
- Download the latest
.zipfrom the repository's Releases page. - Unzip it.
- Drag
PaperDiet.appinto/Applications. - Open
PaperDiet.app. - If macOS shows a
Not Openedwarning, clickDone, then right-clickPaperDiet.appin Finder and chooseOpen. - If macOS still blocks it, open
System Settings>Privacy & Securityand clickOpen AnywayforPaperDiet.
Release artifacts are produced by GitHub Actions and include the Ghostscript runtime plus the repo license and third-party notices. The workflow produces signed and notarized releases when the Apple Developer ID and notary secrets are configured; without those secrets, it still publishes an unsigned release archive.
PaperDiet release builds target Apple Silicon Macs only.
PaperDiet is built with:
SwiftUIfor the app shell and workflowPDFKitfor previewing imported PDFsGhostscriptbehind a Swift service boundary for compression
- Native macOS Xcode project
- Drag-and-drop PDF import
- Multi-file queue with file size and page count analysis
- Output-folder selection
- Compression presets:
Light,Balanced,Strong - Ghostscript discovery from:
- bundled helper at
Contents/Helpers/gs GHOSTSCRIPT_PATH- common install paths
PATH
- bundled helper at
- Background compression execution via
Process - Progress parsing from Ghostscript page output
- Before/after size reporting
- PDF preview for original and compressed output
PaperDiet runs as soon as it can resolve a gs executable. The easiest local setups are:
-
Run
sh Scripts/build-ghostscript-from-source.shto produce a fully relocatable vendored runtime underVendor/ghostscript-runtime. -
Or run
sh Scripts/vendor-ghostscript-from-homebrew.shto copy a local Homebrew install intoVendor/ghostscript-runtime. -
Build the app in Xcode, or use:
xcodebuild -project PaperDiet.xcodeproj -scheme PaperDiet -configuration Debug -derivedDataPath /tmp/PaperDietDerivedData build CODE_SIGNING_ALLOWED=NO
-
If you do not want a vendored runtime, install Ghostscript so
gsis on yourPATH. -
You can also launch Xcode with
GHOSTSCRIPT_PATHpointing at a binary.
The Xcode target is configured for automatic Apple Development signing with team 5WM5U773A8. CI and command-line examples pass CODE_SIGNING_ALLOWED=NO when signing is not required, so contributors can still build without Apple credentials.
Scripts/package-release.shbuilds a Release app, bundles Ghostscript, and creates a distributable.zipindist/.Scripts/sign-app.shoptionally Developer ID-signs the app bundle and nested binaries.Scripts/notarize-release.shoptionally submits the packaged archive to Apple's notary service, staples the ticket to the app, and validates stapling.Scripts/prepare-github-secrets.shbase64-encodes your.p12certificate and.p8notary key into the exact GitHub secret values the release workflow expects.Scripts/upload-github-secrets.shuploads those five signing/notarization secrets to a GitHub repository viagh secret set..github/workflows/ci.ymlvalidates that the app still compiles on GitHub-hosted macOS runners..github/workflows/release.ymlbuilds tagged Apple Silicon releases, uploads release artifacts, and publishes them to GitHub Releases, with signing enabled only when Apple secrets are configured.
The current Xcode project signs local development builds with the Apple Development identity for team 5WM5U773A8. Public GitHub release signing still requires a Developer ID Application certificate plus Apple notary credentials.
To cut a release locally:
sh Scripts/package-release.shTo cut a signed and notarized release locally, optionally provide:
DEVELOPER_ID_APPLICATIONAPPLE_NOTARY_KEY_IDAPPLE_NOTARY_ISSUER_ID- either
APPLE_NOTARY_API_KEY_PATHorAPPLE_NOTARY_API_KEY_BASE64
To cut a release on GitHub:
- Push the repository to GitHub.
- Create and push a tag such as
v0.1.0. - Wait for the
Releaseworkflow to finish. - Download the generated
.zipassets from the GitHub release.
For signed GitHub releases, configure these GitHub Actions secrets:
APPLE_DEVELOPER_ID_CERT_P12_BASE64APPLE_DEVELOPER_ID_CERT_PASSWORDAPPLE_NOTARY_API_KEY_BASE64APPLE_NOTARY_KEY_IDAPPLE_NOTARY_ISSUER_ID
To prepare those secret values from local Apple credential files:
sh Scripts/prepare-github-secrets.sh /absolute/path/DeveloperID.p12 /absolute/path/AuthKey_<KEYID>.p8 <ISSUER-ID>To upload them directly to GitHub:
sh Scripts/upload-github-secrets.sh <owner/repo> /absolute/path/DeveloperID.p12 /absolute/path/AuthKey_<KEYID>.p8 <ISSUER-ID> <P12-PASSWORD>PaperDiet.xcodeproj: native macOS app projectPaperDiet/PaperDietApp.swift: app entry pointPaperDiet/ContentView.swift: main interfacePaperDiet/AppViewModel.swift: queue and workflow statePaperDiet/Models: presets, descriptors, compression resultsPaperDiet/Services: PDF analysis, Ghostscript discovery, process executionPaperDiet/Views: PDFKit wrapper and drag/drop view
Scripts/build-ghostscript-from-source.shdownloads Ghostscript source, builds it intoVendor/ghostscript-runtime, and copies theResourceandiccprofilestrees needed for a relocatable app bundle.Scripts/vendor-ghostscript-from-homebrew.shcopies a local Ghostscript installation into the repo-local vendor directory.Scripts/stage-ghostscript-runtime.shruns during Xcode builds and copies the Ghostscript executable into the app'sHelpersfolder while staging its support files into app resources.- At runtime, PaperDiet prefers the bundled helper and configures
GS_LIB,GS_FONTPATH,DYLD_LIBRARY_PATH,GenericResourceDir,FontResourceDir, andICCProfilesDirfor that bundled layout. - The app bundle also carries
LICENSE.txtandTHIRD_PARTY_NOTICES.mdinContents/Resources.
This keeps Ghostscript as the real compression engine while keeping contributor setup simple.
PaperDiet is licensed under the GNU Affero General Public License v3.0 or later. This repository is set up to stay on Ghostscript's AGPL-compatible path. If you distribute PaperDiet with a bundled Ghostscript runtime, keep the repo license, release assets, and notices aligned with that requirement.
See:
- Add regression fixtures for scanned PDFs, vector PDFs, forms, bookmarks, and signed PDFs.
- Persist security-scoped bookmarks if you want queues to survive relaunches.
- Add batch export naming rules and overwrite behavior controls.
- Add a signed-release smoke test after the Developer ID and notary secrets are configured in CI.