Skip to content

Compatibility Laravel 7 #31

@aleex1848

Description

@aleex1848

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions