I was trying to convert PDF to image. Tried using spatie/pdf-to-image
$pdf = new PDF(public_path('approvedprocess-docs/working_files/5e94d32f99505.certificate.pdf'));
$pdf->saveImage(public_path('approvedprocess-docs/working_files/5e94d32f99505.certificate.jpg'));
Tried using org_heigl/ghostscript
// Create the Ghostscript-Wrapper
$gs = new Ghostscript ();
// Set the output-device
$gs->setDevice('jpeg')
// Set the input file
->setInputFile(public_path('approvedprocess-docs/working_files/5e94d32f99505.certificate.pdf'))
// Set the output file that will be created in the same directory as the input
->setOutputFile('output')
// Set the resolution to 96 pixel per inch
->setResolution(96)
// Set Text-antialiasing to the highest level
->setTextAntiAliasing(Ghostscript::ANTIALIASING_HIGH);
Both case getting error:
InvalidArgumentException
No GS-Path set
My ImageMagick and ghostscript is working fine from cmd command line. So how I can set the gs path?