1. Go to this page and download the library: Download kraenzle-ritter/puidentify library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kraenzle-ritter / puidentify example snippets
use Puidentify\Identifier;
use Puidentify\Engine\FidoEngine;
use Puidentify\Engine\SiegfriedEngine;
// Create identifier with engines (priority order)
$identifier = new Identifier([
new SiegfriedEngine(), // Primary
new FidoEngine() // Fallback
]);
// Identify a file
$result = $identifier->identify('/path/to/file.pdf');
if ($result) {
echo $result; // "PUID: fmt/276 (PDF/A-1b) via Siegfried"
// Access individual properties
echo "PUID: " . $result->puid;
echo "Format: " . $result->formatName;
echo "Engine: " . $result->engine;
}
use Puidentify\Engine\SiegfriedEngine;
use Puidentify\Engine\FidoEngine;
$identifier = new Identifier([
new SiegfriedEngine('/usr/local/bin/sf'),
new FidoEngine('/opt/fido/bin/fido')
]);