Files
crm.clientright.ru/testpage.php

25 lines
764 B
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// Путь к PDF файлу
$filename = "1787.pdf";
try {
// Создаем новый объект Imagick
$imagick = new Imagick();
// Загружаем PDF файл
$imagick->readImage($filename);
// Возвращаем количество страниц в PDF
$numberOfPages = $imagick->getNumberImages();
// Выводим количество страниц
echo "Количество страниц в PDF: " . $numberOfPages . "<br>";
// Очищаем память
$imagick->clear();
$imagick->destroy();
} catch (Exception $e) {
// В случае ошибки выводим сообщение об ошибке
echo "Ошибка: " . $e->getMessage();
}