- PHP Version: 8.1.24
- PDFParser Version: 2.12.5
Description:
User of the website im working on apparently used the website https://online2pdf.com to convert a word document into a pdf.
This website seems to generate PDFs in a weird way:
Instead of just putting the text into the page object as content it generated a form object containing the text and referenced this object in the page content with the Do command.
Currently PDFParser doesnt support the Do command and also can't correctly extract content (DataTm) from form objects.
PDF input
Test.pdf
Expected output & actual output
Expected:
Array containing the text Test and the coordinates of this textarea
Actual:
Code
$filepath = "C:/Users/dd/Desktop/Test.pdf";
$filecontent = file_get_contents($filepath);
$config = new Config();
$config->setDataTmFontInfoHasToBeIncluded(true);
$parser = new Parser([], $config);
$pdf = $parser->parseContent($filecontent);
$pages = $pdf->getPages();
foreach ($pages as $page) {
var_dump($page->getDataTm());
}
Description:
User of the website im working on apparently used the website https://online2pdf.com to convert a word document into a pdf.
This website seems to generate PDFs in a weird way:
Instead of just putting the text into the page object as content it generated a form object containing the text and referenced this object in the page content with the
Docommand.Currently PDFParser doesnt support the
Docommand and also can't correctly extract content (DataTm) from form objects.PDF input
Test.pdf
Expected output & actual output
Expected:
Array containing the text
Testand the coordinates of this textareaActual:
Code