From 6a160d22fe4a5712156013fd6aeace9fc5ed3fe7 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 28 Jul 2015 04:36:58 -0700 Subject: [PATCH] Update release notes, add copyrights --- LICENSE.rst | 2 +- README.rst | 19 ++++--- RELEASE_NOTES.rst | 90 +++++++++++++++++++++++++++------- ocrmypdf/ghostscript.py | 2 + ocrmypdf/leptonica.py | 2 +- ocrmypdf/main.py | 1 + ocrmypdf/pageinfo.py | 2 +- ocrmypdf/pdfa.py | 4 +- ocrmypdf/tesseract.py | 1 + ocrmypdf/test/test_pageinfo.py | 1 + ocrmypdf/unpaper.py | 1 + setup.py | 1 + tests/test_main.py | 1 + 13 files changed, 96 insertions(+), 31 deletions(-) diff --git a/LICENSE.rst b/LICENSE.rst index 382e058d..ec3f0f9e 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -1,4 +1,4 @@ -Copyright (c) 2013 fritz-hh from Github +Copyright (c) 2013-2015, The OCRmyPDF Authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.rst b/README.rst index 05a22486..26f2f5a2 100644 --- a/README.rst +++ b/README.rst @@ -2,9 +2,7 @@ OCRmyPDF ======== OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to -be searched - -To get the script usage, call: sh ./OCRmyPDF.sh -h +be searched. Main features ------------- @@ -18,12 +16,13 @@ Main features - or if requested oversamples the images before OCRing so as to get better results -- If requested deskews and / or clean the image before performing OCR +- If requested deskews and/or cleans the image before performing OCR - Validates the generated file against the PDF/A-1b specification using `JHOVE `__ - Provides debug mode to enable easy verification of the OCR results -- Processes several pages in parallel if more than one CPU core is +- Processes several pages in parallel when more than one CPU core is available +- Uses Tesseract OCR engine For details: please consult the release notes @@ -50,9 +49,13 @@ Install Download OCRmyPDF here: https://github.com/fritz-hh/OCRmyPDF/releases -Copy the file in onto your linux/unix machine and extract it. +To install, extract the release files and run:: -Run: "sh ./OCRmyPDF.sh -h" to get the script usage + pip install . + +Run:: + + ocrmypdf --help If not yet installed, the script will notify you about dependencies that need to be installed. The script requires specific versions of the @@ -69,7 +72,7 @@ In case you detect an issue, please: https://github.com/fritz-hh/OCRmyPDF/issues - Describe your problem thoroughly - Append the console output of the script when running the debug mode - (-g option) + (-v 1 option) - If possible provide your input PDF file as well as the content of the temporary folder (using a file sharing service like www.file-upload.net) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 11453687..18a8915b 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -8,29 +8,85 @@ Download software here: https://github.com/fritz-hh/OCRmyPDF/tags v3.0-rc1: ========= +New features +------------ + +- Easier installation with Python's package manager +- Now installs ``ocrmypdf`` to ``/usr/local/bin`` or equivalent for system-wide + access +- Tesseract 3.03 PDF page can be used instead for better positioning + of recognized text (``--pdf-renderer tesseract``) +- Improved command line syntax and usage help (``--help``) +- PDF metadata (title, author, keywords) are now transferred to the + output PDF +- PDF metadata can also be set from the command line (``--title``, etc.) +- Added test cases to confirm everything is working +- Added option to skip extremely large pages that take too long to OCR and are + often not OCRable (e.g. large scanned maps or diagrams); other pages are still + processed (``--skip-big``) +- Added option to kill Tesseract OCR process if it seems to be taking too long on + a page, while still processing other pages (``--tesseract-timeout``) + Changes ------- -- New, robust Python 3.4+ implementation based on ruffus pipelines +- New, robust rewrite in Python 3.4+ with ruffus_ pipelines +- Now uses Ghostscript 9.14's improved color conversion model - All "tasks" in the pipeline can be executed in parallel on any - available CPUs -- Removed dependencies on several packages: -- parallel -- ImageMagick -- Python 2.7 -- shell -- Updated dependencies -- Ghostscript 9.14 -- Unpaper 6.1 (now optional) -- Tesseract 3.02 and 3.03 -- Python's reportlab 3 -- Unpaper 6.1 is now an optional dependency + available CPUs, increasing performance +- The ``-o DPI`` argument has been phased out, in favor of ``--oversample DPI`` +- Removed several dependencies, so it's easier to install. We no + longer use: + + - GNU parallel_ + - ImageMagick_ + - Python 2.7 + - shell scripts + +- Some new external dependencies are required: + + - MuPDF_ tools + - Ghostscript 9.14+ + - Unpaper_ 6.1 (optional) + - some automatically managed Python dependencies + +.. _ruffus: http://www.ruffus.org.uk/index.html +.. _parallel: https://www.gnu.org/software/parallel/ +.. _ImageMagick: http://www.imagemagick.org/script/index.php +.. _MuPDF: http://mupdf.com/docs/ +.. _Unpaper: https://github.com/Flameeyes/unpaper + +Compatibility notes +------------------- + +- ``./OCRmyPDF.sh`` script is still available for now +- Stacking the verbosity option like ``-vvv`` is no longer supported + +- The configuration file ``config.sh`` has been removed. Instead, you can + feed a file to the arguments for common settings: + +:: + + ocrmypdf input.pdf output.pdf @settings.txt + +where ``settings.txt`` contains, for example: + +:: + + -l deu --author 'A. Merkel' --pdf-renderer tesseract + Fixes ----- -- Document metadata from the source PDF is copied to the output PDF - (Title, Author, etc.) +- Handling of filenames containing spaces: fixed + +Notes +----- + +- Some dependencies may work with lower versions than tested, so try + overriding dependencies if they are "in the way" to see if they work. + v2.1-stable (2014-09-20): ========================= @@ -262,8 +318,8 @@ Changes to final PDF file that does not comply to the PDF/A-1 format) - Removed feature to set same owner & permissions in final PDF file than in input file -- Removed many unused jhove files (e.g. documentation, *.java and - *.class files) +- Removed many unused jhove files (e.g. documentation, \*.java and + \*.class files) Fixes ----- diff --git a/ocrmypdf/ghostscript.py b/ocrmypdf/ghostscript.py index 531ea01d..3d80ef0b 100644 --- a/ocrmypdf/ghostscript.py +++ b/ocrmypdf/ghostscript.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# © 2015 James R. Barlow: github.com/jbarlow83 + from tempfile import NamedTemporaryFile from subprocess import Popen, PIPE, check_call from shutil import copy diff --git a/ocrmypdf/leptonica.py b/ocrmypdf/leptonica.py index cc5c8b38..a03a1af5 100644 --- a/ocrmypdf/leptonica.py +++ b/ocrmypdf/leptonica.py @@ -1,7 +1,7 @@ #!/usr/bin/env python2 # -*- coding: utf-8 -*- # -# © 2013-14: jbarlow83 from Github (https://github.com/jbarlow83) +# © 2013-15: jbarlow83 from Github (https://github.com/jbarlow83) # # # Use Leptonica to detect find and remove page skew. Leptonica uses the method diff --git a/ocrmypdf/main.py b/ocrmypdf/main.py index 74a2a44e..3a94affb 100755 --- a/ocrmypdf/main.py +++ b/ocrmypdf/main.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# © 2015 James R. Barlow: github.com/jbarlow83 from contextlib import suppress from tempfile import NamedTemporaryFile, mkdtemp diff --git a/ocrmypdf/pageinfo.py b/ocrmypdf/pageinfo.py index bb793981..81231653 100644 --- a/ocrmypdf/pageinfo.py +++ b/ocrmypdf/pageinfo.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# +# © 2015 James R. Barlow: github.com/jbarlow83 from subprocess import Popen, PIPE from decimal import Decimal, getcontext diff --git a/ocrmypdf/pdfa.py b/ocrmypdf/pdfa.py index 6375b958..503830a9 100644 --- a/ocrmypdf/pdfa.py +++ b/ocrmypdf/pdfa.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# © 2015: jbarlow83 (https://github.com/jbarlow83) +# © 2015 James R. Barlow: github.com/jbarlow83 # # Generate a PDFA_def.ps file for Ghostscript >= 9.14 diff --git a/ocrmypdf/tesseract.py b/ocrmypdf/tesseract.py index 101ce927..9a542019 100644 --- a/ocrmypdf/tesseract.py +++ b/ocrmypdf/tesseract.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# © 2015 James R. Barlow: github.com/jbarlow83 from subprocess import STDOUT, CalledProcessError, check_output import sys diff --git a/ocrmypdf/test/test_pageinfo.py b/ocrmypdf/test/test_pageinfo.py index fb3b474b..19bfd65f 100644 --- a/ocrmypdf/test/test_pageinfo.py +++ b/ocrmypdf/test/test_pageinfo.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# © 2015 James R. Barlow: github.com/jbarlow83 from ocrmypdf import pageinfo from reportlab.pdfgen.canvas import Canvas diff --git a/ocrmypdf/unpaper.py b/ocrmypdf/unpaper.py index 0cfe8679..a8c0d202 100644 --- a/ocrmypdf/unpaper.py +++ b/ocrmypdf/unpaper.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# © 2015 James R. Barlow: github.com/jbarlow83 # unpaper documentation: # https://github.com/Flameeyes/unpaper/blob/master/doc/basic-concepts.md diff --git a/setup.py b/setup.py index f502cab2..53b44879 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# © 2015 James R. Barlow: github.com/jbarlow83 from setuptools import setup from subprocess import Popen, STDOUT, check_output, CalledProcessError diff --git a/tests/test_main.py b/tests/test_main.py index 9fd0735a..770853aa 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# © 2015 James R. Barlow: github.com/jbarlow83 from __future__ import print_function from subprocess import Popen, PIPE, check_output