PDF Optimizer
  • 🏁Getting Started
    • Introduction
    • Installation
    • Support Us
    • License
  • 🚀Basic Usage
    • Standalone PHP
    • Laravel
  • ⚙️Advanced Usage
    • Ghostscript Binary Configuration
    • Timeout
    • Logger
    • Custom Ghostscript Options
    • Export Script
    • Configuring Ghostscript
      • ASCII85EncodePages
      • AutoFilterColorImages
      • AutoFilterGrayImages
      • AutoRotatePages
      • ColorConversionStrategy
      • ColorImageDepth
      • ColorImageFilter
      • ColorImageDownsampleThreshold
      • ColorImageDownsampleType
      • ColorImageResolution
      • CompatibilityLevel
      • CompressFonts
      • CompressPages
      • ConvertCMYKImagesToRGB
      • DefaultRenderingIntent
      • DetectDuplicateImages
      • DownsampleColorImages
      • DownsampleGrayImages
      • DownsampleMonoImages
      • EmbedAllFonts
      • EncodeColorImages
      • EncodeGrayImages
      • EncodeMonoImages
      • FastWebView
      • GrayImageDepth
      • GrayImageDownsampleThreshold
      • GrayImageDownsampleType
      • GrayImageFilter
      • GrayImageResolution
      • LockDistillerParams
      • MaxInlineImageSize
      • MaxSubsetPct
      • MonoImageDepth
      • MonoImageDownsampleThreshold
      • MonoImageDownsampleType
      • MonoImageFilter
      • MonoImageResolution
      • PassThroughJPEGImages
      • PassThroughJPXImages
      • ParseDSCComments
      • ParseDSCCommentsForDocInfo
      • PDFA
      • PDFACompatibilityPolicy
      • PDFX
      • PreserveEPSInfo
      • PreserveHalftoneInfo
      • PreserveMarkedContent
      • PreserveOPIComments
      • PreserveOverprintSettings
      • ProcessColorModel
      • PDFSETTINGS
      • SubsetFonts
      • UCRandBGInfo
      • UseFlateCompression
  • 🎮Laravel Deep Dive
    • Filesystem
    • Queue
Powered by GitBook
On this page
  • Requirements:
  • 1. Install Ghostscript
  • 2. Install the package via composer
  • 3. Publish config file (Laravel Only)
  • 4. Done

Was this helpful?

  1. Getting Started

Installation

PreviousIntroductionNextSupport Us

Last updated 1 year ago

Was this helpful?

Requirements:

  • PHP 8.2 or higher

1. Install Ghostscript

sudo apt update -y
sudo apt-get install ghostscript
sudo apk add --upgrade ghostscript
brew install ghostscript
  1. Download and install

  2. Add Ghostscript to your system path

  3. Restart your computer

Note: This package has not been tested on Windows machines. While it is designed to work seamlessly on Unix-based systems, users on Windows may experience compatibility issues.

We recommend testing the package in a Windows environment and welcome any feedback or contributions to enhance Windows compatibility. If you encounter issues or have suggestions for improving Windows support, please feel free to open an issue on our GitHub repository. Thank you for your understanding.

2. Install the package via composer

composer require mostafaznv/pdf-optimizer

3. Publish config file (Laravel Only)

php artisan vendor:publish --provider="Mostafaznv\PdfOptimizer\PdfOptimizerServiceProvider"

If you're using Laravel, this command publishes the configuration file, allowing you to customize pdf-optimizer settings.

4. Done

🏁
Ghostscript
Ghostscript