ocropus / hocr-tools

Tools for manipulating and evaluating the hOCR format for representing multi-lingual OCR results by embedding them into HTML.
Other
364 stars 79 forks source link

Fix compat with windows by adding savefile argument to hocr-pdf #125

Closed skylord123 closed 6 years ago

skylord123 commented 6 years ago

I couldn't get hocr-pdf to work in windows because it outputs to stdout and windows doesn't handle the latin1 encoding very well (and created corrupt PDFs for me even when using chcp 65001 and set PYTHONIOENCODING=utf-8) . I was able to get this to work by adding an optional argument for which file to save the document to (instead of outputting to stdout).

I would have preferred to use a Linux OS but the company I work for uses windows servers. This update makes it work for both without having to deal with the encoding headache.

stweil commented 6 years ago

Thank you!