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

Cropped pages after run of pdfocr #42

Open
InCaseItWorks opened this issue Mar 17, 2021 · 0 comments
Open

Cropped pages after run of pdfocr #42

InCaseItWorks opened this issue Mar 17, 2021 · 0 comments

Comments

@InCaseItWorks
Copy link

Hello

There seems to be a problem with the final step in the pdfocr script. Running pdfocr produces a heavily cropped pdf file. Most of each page is missing.

Actual Result:
Cropped pdf file

Expected Result:
Pdf file in original dimensions

Description:
I'm running the command in a script like so:
pdfocr -i $FILENAME.tmp.pdf -l deu -w . -k -o $FILENAME.pdf

Turning the -k option on shows me the "merged.pdf" file in the working directory ("pdfocr") which is still perfectly fine, size, OCRed text, and all. But the final pdf is heavily cropped.

Comparing the pdf metadata of the final file and "merged.pdf" with "pdftk merged.pdf dump_data" shows the differences in dimensions.

Commenting out line 374 in "pdfocr.rb" prevents the final file from being created and the metadata from being updated, so up to this point everything seems to work properly. The line is:

sh "pdftk", tmp+'/merged.pdf', "update_info", tmp+'/pdfinfo.txt', "output", outfile

Unfortunately, I don't 'speak' Ruby, so I don't know what I'd be doing if I were to edit the pdfocr script. I'm using a workaround now by simply deleting the final file and moving "merged.pdf".

My System:
Ubuntu 20.10, pdfocr 0.1.4, ruby 2.7.1p83, pdftk 3.1.1

If there's any further information I can provide, please let me know.

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