diff --git a/src/Smalot/PdfParser/Document.php b/src/Smalot/PdfParser/Document.php index 964592e4..a44b133a 100644 --- a/src/Smalot/PdfParser/Document.php +++ b/src/Smalot/PdfParser/Document.php @@ -33,6 +33,7 @@ namespace Smalot\PdfParser; use Smalot\PdfParser\Encoding\PDFDocEncoding; +use Smalot\PdfParser\Exception\MissingCatalogException; /** * Technical references : @@ -379,7 +380,7 @@ public function getFirstFont(): ?Font /** * @return Page[] * - * @throws \Exception + * @throws MissingCatalogException */ public function getPages() { @@ -415,7 +416,7 @@ public function getPages() return array_values($pages); } - throw new \Exception('Missing catalog.'); + throw new MissingCatalogException('Missing catalog.'); } public function getText(?int $pageLimit = null): string diff --git a/src/Smalot/PdfParser/Exception/InvalidDictionaryObjectException.php b/src/Smalot/PdfParser/Exception/InvalidDictionaryObjectException.php new file mode 100644 index 00000000..745bd574 --- /dev/null +++ b/src/Smalot/PdfParser/Exception/InvalidDictionaryObjectException.php @@ -0,0 +1,12 @@ +