Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility Laravel 7 #31

Open
aleex1848 opened this issue Feb 16, 2022 · 0 comments
Open

Compatibility Laravel 7 #31

aleex1848 opened this issue Feb 16, 2022 · 0 comments

Comments

@aleex1848
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant