PHP code example of tecnickcom / tc-lib-pdf-parser
1. Go to this page and download the library: Download tecnickcom/tc-lib-pdf-parser 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/ */
tecnickcom / tc-lib-pdf-parser example snippets
$parser = new \Com\Tecnick\Pdf\Parser\Parser();
[$xref, $objects] = $parser->parse((string) $raw);
foreach ($parser->getLimitWarnings() as $warning) {
// "the indirect object resolution depth limit (64) left a reference
// unresolved 7 times, first at object 128_0"
}
= file_get_contents('/path/to/document.pdf');
$parser = new \Com\Tecnick\Pdf\Parser\Parser(['ignore_filter_errors' => true]);
// $xref holds the cross-reference and trailer data,
// $objects the parsed objects keyed as "[object number]_[generation number]"
[$xref, $objects] = $parser->parse((string) $raw);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.