Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf_production.py produces incorrect results #63

Open
mzilinec opened this issue Sep 13, 2024 · 0 comments
Open

pdf_production.py produces incorrect results #63

mzilinec opened this issue Sep 13, 2024 · 0 comments

Comments

@mzilinec
Copy link

Hello, while experimenting with PERO I have noticed a few problems with pero_ocr.document_ocr.pdf_production, namely:

  • in my case, resulting PDF lines from the OCR were consistently offset (one line below the original line in the PDF) - example below
  • occasionally, fpdf would produce a page break when text is too close to the border, causing the output to be invalid,
  • the script crashes due to fonts being moved to a different location in newer linux distributions

This can be easily fixed by:

  • replacing bottom with bottom - line.heights[0] + line.heights[1]
  • calling pdf.set_auto_page_break(False)
  • making the font into a default parameter

If you want, I can send a PR.

Example output:
Screen Shot 2024-09-13 at 10 52 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant