Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.137.200.56
<?php
//lib16107 lib16103
ini_set('display_errors', 1);
ini_set('display_errors', 'on');
ini_set('memory_limit','900M');
ini_set('max_execution_time',900);
$imagick = new Imagick();
$imagick->readImage('19FSD501B_BB022086.pdf[1]');
$imagick->writeImages('19FSD501B_BB022086.webp', false);
// //$pdfFilePath = '/var/www/html/univadmin/PDA104T_AA000322_001_0001.jpg';
// // Path where you want to save the resulting WebP file
// $webpFilePath = '/var/www/html/univadmin/PDA104T_AA000322_001_0001.webp';
// // Create Imagick object
// $image = new Imagick();
// // Set the resolution for better quality (optional)
// $image->setResolution(300, 300);
// // Read the PDF file
// $image->readImage($pdfFilePath);
// // Convert the PDF to WebP format
// $image->setImageFormat('webp');
// // Write the WebP file
// $image->writeImage($webpFilePath);
// // Clear resources
$imagick->clear();
$imagick->destroy();
//
//echo 'PDF converted to WebP successfully!';
?>
|