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

Try to use ghostscript directly for page count #171

Closed
wants to merge 3 commits into from

Conversation

ArroWsGM
Copy link

Using GhostScript directly is much faster than Imagick because it doesn't take a screenshot of every page as Imagick does. It faster even with a relatively small pdf with 2 pages.

@truechernyshov
Copy link

@ArroWsGM If you use exec function you no need this package. I did thumbnail of first page just execute exec('convert -background white -alpha remove '.$path_to_uploaded_pdf.'[0] '.$target_folder . '/thumbnail.jpg');

@ArroWsGM
Copy link
Author

@truechernyshov I don't understand the purposes of this post. I can decide what I'm needed by myself, but if you want to play with Captain Obvious, ok, let's begin.

First of all, exec function is not always accessible due to disable_functions restriction which not always under your control.

Second - a path for exec function needs to be escaped for a cross-platform app, because on windows and *nix systems it completely differs, and its part is really tricky and can cause errors.

So, if I don't want or don't have time for developing a package to handle this, I need to find a package, which will do it for me.

@spatie-bot
Copy link

Dear contributor,

because this pull request seems to be inactive for quite some time now, I've automatically closed it. If you feel this pull request deserves some attention from my human colleagues feel free to reopen it.

@spatie-bot spatie-bot closed this Jul 20, 2021
@mfe-a5sys
Copy link

So, if I don't want or don't have time for developing a package to handle this, I need to find a package, which will do it for me.

Here :
https://symfony.com/doc/current/components/process.html

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

Successfully merging this pull request may close these issues.

4 participants