Ghostscript Binary Configuration

Customize the Ghostscript binary path used by pdf-optimizer to match your environment. This option provides flexibility in specifying the exact location of the Ghostscript binary on your server.

You can specify the exact path to the Ghostscript binary file by passing it to the init method of the PdfOptimizer class.

use Mostafaznv\PdfOptimizer\PdfOptimizer;

PdfOptimizer::init('/path/to/gs')->optimize('input.pdf', 'output.pdf');

Last updated