so while developing a webapp I encountered a problem I could not find an answer to. Let's say we have this html
<form method="post" enctype="multipart/form-data" action="/upload.php">
<label> Upload .pdf here
<input name="menu" type="file" accept=".pdf">
</label>
<button>Submit</button>
</form>
And now this PHP to handle it:
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
$menu = $_POST['menu'];
//convert whatever type menu is to something readable for Imagick
// create Imagick object
$imagick = new Imagick();
// Reads image from PDF
$imagick->readImage($menu);
// Writes an image or image sequence Example- converted-0.jpg, converted-1.jpg
$imagick->writeImages('menu.jpg', false);
echo $imagick;
I couldn't find any solution anywhere else so I thought I'd ask my first ever queston on stackoverflow. Thanks for helping me out!