hi,
i need your package for using in laravel 7. Therefore symfony/process needs be updated to version 5.
in version 5 the command needs to be given to the process() as array like described here https://symfony.com/doc/current/components/process.html#usage . i changed the run function in your class GhostscriptConverterCommand
to this:
$command = sprintf($this->baseCommand, $newVersion, $newFile);
$command_new = explode(' ',$command);
array_push($command_new,$originalFile);
$process = new Process($command_new);
$process->run();
and the $baseCommand to this
protected $baseCommand = 'gs -sDEVICE=pdfwrite -dCompatibilityLevel=%s -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -dColorConversionStrategy=/LeaveColorUnchanged -dEncodeColorImages=false -dEncodeGrayImages=false -dEncodeMonoImages=false -dDownsampleMonoImages=false -dDownsampleGrayImages=false -dDownsampleColorImages=false -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -sOutputFile=%s';
for my use case it's working now.
hi,
i need your package for using in laravel 7. Therefore symfony/process needs be updated to version 5.
in version 5 the command needs to be given to the process() as array like described here https://symfony.com/doc/current/components/process.html#usage . i changed the run function in your class GhostscriptConverterCommand
to this:
and the $baseCommand to this
protected $baseCommand = 'gs -sDEVICE=pdfwrite -dCompatibilityLevel=%s -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -dColorConversionStrategy=/LeaveColorUnchanged -dEncodeColorImages=false -dEncodeGrayImages=false -dEncodeMonoImages=false -dDownsampleMonoImages=false -dDownsampleGrayImages=false -dDownsampleColorImages=false -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -sOutputFile=%s';for my use case it's working now.