This project is licensed under the MIT License - see the LICENCE.md file for details. Add different encrypted informations: Encrypted: yes (print:yes copy:yes change:yes addNotes:yes).To run this change into the directory public and run php -S localhost:8000 PHP has an in-built server for local development. Phpunit will automatically find all tests inside the tests directory and run them based on the configuration in the phpunit.xml file. Running the TestsĪll tests can be run by executing vendor/bin/phpunit If you have a passwort protected pdf file: // $info = $pdfInfo->exec('.pdf', 'OwnerPassword') // $info = $pdfInfo->exec('.pdf', null, 'UserPassword') // Access the pdf informations echo $info-> Creator // Creator echo $info-> Producer // Producer echo $info-> CreationDate // Creation date echo $info-> ModDate // Modification date echo $info-> Tagged // Tagged (true/false) echo $info-> Form // Form(s) echo $info-> Pages // Number of pages echo $info-> PageSize-> Width // Page width as points echo $info-> PageSize-> Height // Page height as points echo $info-> PageSize-> Format // Page format (if found) echo $info-> PageSize-> RotatedDegrees // Degrees if rotated echo $info-> PageSize-> raw // Raw shell output for page size // Available boxes: MediaBox, CropBox, BleedBox, TrimBox, ArtBox echo $info-> MediaBox-> X // X coordinate echo $info-> MediaBox-> Y // Y coordinate echo $info-> MediaBox-> Width // Box width as points echo $info-> MediaBox-> Height // Box height as points echo $info-> MediaBox-> raw // Raw shell output for box echo $info-> FileSize-> Bytes // File size in bytes echo $info-> FileSize-> raw // Raw shell output for file size echo $info-> Encrypted // Encrypted (true/false) echo $info-> Optimized // Optimized (true/false) echo $info-> PDFVersion // Version echo $info-> raw // Raw shell output from pdfinfo // Get page size as millimeter: echo $info-> PageSize-> Width / PdfInfo:: MM_TO_PTS // = Convert points to millimeter echo $info-> PageSize-> Height / PdfInfo:: MM_TO_PTS // = Convert points to millimeter Example This is what I intended as a second resort, because its also a way that the search engine programmer explains: copying only the two files pdftotext and pdfinfo into cgi-bin - thats why I initally just asked for the two binaries. Usage ') /** PdfInfoModel $info */ $info = $pdfInfo-> exec( '.pdf') Installing composer require csoellinger/xpdf-cli-pdfinfo PHP 7 or above and Composer is expected to be installed on your system. Param, you will get a process failed exception. Note: If you have a password protected pdf file, and not setting the password A little PHP wrapper around the Xpdf cli tool: pdfinfo.įetching the following informations and make them easy accessible:
0 Comments
Leave a Reply. |