Open ghost opened 3 years ago
tbh, I don't really touch windows so am unsure. I think try following the instructions here: https://www.ghostscript.com/doc/current/Install.htm#Install_Windows
let me know how you get on? I should probably write how to install that down somewhere....
I installed GS on my computer then I added the environment variable and still nothing.
We usually distribute Ghostscript releases for Windows as a binary installer
I think you need to double-click and run that executable....
So there’s no option to run php script on Windows? :/
Maybe there is option to add PATH to GS binary into ImagickPHP? That should solve my problem.
Hi, I need to run a php script on localhost and I'm using XAMPP for that. I installed everything that I needed and I tried to convert PNG to JPG - everything went fine. I made another attempt to convert the first page of the PDF file to JPG - this time i got Fatal error: at C:\xampp\htdocs\pdf-ocr\test.php on line 3. I read that I am missing ghostscript which is required to work with PDF files, but I have no idea how to install GS on a localhost. I installed GS in C:\Program Files\gs\gs9.55.0 but the error still persists. I am asking for help, I have been working on solving the problem for 2 days ...
System: Windows 10 Compiler: Visual C++ 2017 Architecture: x64 Thread Safety: enabled Imagick Version: 3.5.1
Installation process:
Result:
Script:
<?php
$imagick = new Imagick();
$imagick->readImage(__DIR__ . '/uploads/userfile.pdf[0]');
$imagick->setResolution(300, 300);
$imagick->setImageCompressionQuality(100);
$imagick->writeImages(__DIR__ . '/uploads/images/page-0.jpg', false);
?>