Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Pdf\Conformance\Inspection; |
| 6 | |
| 7 | use Phpdftk\Pdf\Core\Document\Catalog; |
| 8 | use Phpdftk\Pdf\Core\Document\Info; |
| 9 | use Phpdftk\Pdf\Core\Document\Page; |
| 10 | use Phpdftk\Pdf\Core\Graphics\XObject\FormXObject; |
| 11 | use Phpdftk\Pdf\Core\Graphics\XObject\ImageXObject; |
| 12 | use Phpdftk\Pdf\Core\PdfObject; |
| 13 | use Phpdftk\Pdf\Core\ThreeD\ThreeDStream; |
| 14 | |
| 15 | /** |
| 16 | * Abstract inspection interface for conformance validation. |
| 17 | * |
| 18 | * Provides read-only access to the document structure for constraint |
| 19 | * checking, decoupled from whether the document was built via PdfWriter |
| 20 | * or parsed via PdfReader. |
| 21 | */ |
| 22 | interface DocumentInspector |
| 23 | { |
| 24 | public function getCatalog(): Catalog; |
| 25 | |
| 26 | public function getInfo(): ?Info; |
| 27 | |
| 28 | /** @return iterable<Page> */ |
| 29 | public function getPages(): iterable; |
| 30 | |
| 31 | /** @return iterable<PdfObject> All fonts registered (Font or Type0Font instances). */ |
| 32 | public function getFonts(): iterable; |
| 33 | |
| 34 | /** Whether the document has encryption configured. */ |
| 35 | public function hasEncryption(): bool; |
| 36 | |
| 37 | /** Whether the catalog has an XMP metadata stream. */ |
| 38 | public function hasXmpMetadata(): bool; |
| 39 | |
| 40 | /** Raw XMP XML bytes, or null if no metadata stream. */ |
| 41 | public function getXmpBytes(): ?string; |
| 42 | |
| 43 | /** Whether the catalog has OutputIntents. */ |
| 44 | public function hasOutputIntents(): bool; |
| 45 | |
| 46 | /** Whether any OutputIntent has an embedded ICC profile (/DestOutputProfile). */ |
| 47 | public function hasOutputIntentWithIccProfile(): bool; |
| 48 | |
| 49 | /** Whether any page uses a transparency group. */ |
| 50 | public function hasTransparency(): bool; |
| 51 | |
| 52 | /** Whether the document contains JavaScript actions. */ |
| 53 | public function hasJavaScript(): bool; |
| 54 | |
| 55 | /** Whether the document contains embedded files. */ |
| 56 | public function hasEmbeddedFiles(): bool; |
| 57 | |
| 58 | /** |
| 59 | * All registered PdfObject instances. |
| 60 | * |
| 61 | * @return iterable<PdfObject> |
| 62 | */ |
| 63 | public function getRegisteredObjects(): iterable; |
| 64 | |
| 65 | /** Whether the document contains 3D annotations. */ |
| 66 | public function hasThreeDAnnotations(): bool; |
| 67 | |
| 68 | /** @return iterable<ThreeDStream> All 3D streams in the document. */ |
| 69 | public function getThreeDStreams(): iterable; |
| 70 | |
| 71 | /** Whether all page content is raster-only (no text operators, no vector paths). */ |
| 72 | public function hasRasterOnlyContent(): bool; |
| 73 | |
| 74 | /** @return iterable<ImageXObject> All image XObjects in the document. */ |
| 75 | public function getImageXObjects(): iterable; |
| 76 | |
| 77 | /** Whether the document contains interactive forms (AcroForm). */ |
| 78 | public function hasInteractiveForms(): bool; |
| 79 | |
| 80 | /** Whether the document contains multimedia content (movies, sounds, renditions). */ |
| 81 | public function hasMultimediaContent(): bool; |
| 82 | |
| 83 | /** @return iterable<FormXObject> All FormXObjects with a /Ref (reference XObject) entry. */ |
| 84 | public function getReferenceXObjects(): iterable; |
| 85 | } |