1

I'm building a Laravel application which has the functionality to auto-generate thumbnail images from PDF files uploaded by user.

Using spatie/pdf-to-image.

$preview_img = $pdf->setPage(1)->setOutputFormat('png')->saveImage($path.'/'.$filename);

[Error] No GS-Path set when trying to call saveImage() function.

Workaround by setting GS Path following this tutorial: https://www.youtube.com/watch?v=0lhM7m_oHj4&ab_channel=Engineer%27sCommunityGuide

Ghostscript::setGsPath("C:\Program Files\gs\gs9.52\bin\gswin64c.exe");

However, how do I ensure that Ghostscript still works across different environments (especially production) without having to download the GS files seperately for different environments?

1
  • Did you find a solution?
    – Quatsch
    Aug 4, 2021 at 15:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.