pdfparser icon indicating copy to clipboard operation
pdfparser copied to clipboard

Mixed text from Columns

Open wackerm opened this issue 11 years ago • 2 comments

If there are text columns in the pdf, the text via getText() is mangled together.

For e.g:

Column Column
This is Column This is Column
one, and there is two and there is
even more text not more text

gets transformed to

This ist Column This is Column
one, and there is two and there is
even more text not more text

Maybe this could be targeted by using some special chars like tab "\t"?

wackerm avatar May 28 '15 16:05 wackerm

This is fixed with #505 You can now do this:

$config = new \Smalot\PdfParser\Config();
$config->setHorizontalOffset("\t");

$parser = new \Smalot\PdfParser\Parser([], $config);
$pdf = $parser->parseFile('path/to/file');
$text = $pdf->getText();

rubenvanerk avatar Jan 19 '22 10:01 rubenvanerk

Closed. Please reopen if problem persists.

k00ni avatar Jan 19 '22 13:01 k00ni