smalot / smalot/pdfparser

Necessary whitespace is not being preserved.

Open
#438 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
PHP
Stars
2.7k
Forks
579
Avg merge
2m
Merged PRs (30d)
1

Description

Test case: Input Pdf file is 501 German Verbs.pdf available at downloaded from https://archive.org/details/501GermanVerbs
Code:

include 'vendor/autoload.php';
$parser = new \Smalot\PdfParser\Parser();
$pdf    = $parser->parseFile('./501 German Verbs.pdf');
 
$text = $pdf->getText();
file_put_contents('./output.txt', $text);

Line 433 should begin with
ich werde sprechen
instead it is:
ichwerde sprechen

There dozens and dozens of similar lines throughout the document where "ich"--which is the German pronoun for I--is NOT followed by a whitespace character.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with 501 German Verbs.pdf using vendor/autoload.php, Parser, parseFile, and getText(), then inspect the text-extraction path reached by that entry point. Compare output.txt with line 433 and the other reported occurrences; done means the whitespace after "ich" is preserved in the extracted text.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.