Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e30fffa8a4 | ||
|
|
e760be9e19 | ||
|
|
38280e77f8 | ||
|
|
6b9b5cc5d5 | ||
|
|
5f01c5e330 | ||
|
|
5d08303805 | ||
|
|
7965b1f930 | ||
|
|
0a1216bf14 | ||
|
|
f10a0f7707 | ||
|
|
dc11802809 | ||
|
|
4cce0077d0 | ||
|
|
d293e05946 | ||
|
|
4030258bbc | ||
|
|
db388165a9 | ||
|
|
3d6907f7f6 | ||
|
|
701c3b371b | ||
|
|
684e5b4944 | ||
|
|
a964080f77 | ||
|
|
3f72f16958 | ||
|
|
b4f2582766 | ||
|
|
c77cc7c837 | ||
|
|
f3715daf15 | ||
|
|
c87221a4e6 |
+1
-6
@@ -37,12 +37,7 @@ COPY . /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN pip3 install --no-cache-dir \
|
||||
-r requirements/main.txt \
|
||||
-r requirements/webservice.txt \
|
||||
-r requirements/test.txt \
|
||||
-r requirements/watcher.txt \
|
||||
.
|
||||
RUN pip3 install --no-cache-dir .[test,webservice,watcher]
|
||||
|
||||
FROM base
|
||||
|
||||
|
||||
@@ -14,7 +14,14 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
A clear and concise description of any alternative solutions or features you've considered. Please include the versions of OCRmyPDF and other supporting programs (Tesseract OCR, Ghostscript) - maybe an alternative already exists in a newer version.
|
||||
|
||||
**Example file**
|
||||
If your issue concerns how OCRmyPDF processes certain files, and please provide an example file that helps illustrate how OCRmyPDF's output could be improve.
|
||||
|
||||
Please provide an input file with no personal or confidential information. At your option you may [GPG-encrypt the file](https://github.com/jbarlow83/OCRmyPDF/wiki) for OCRmyPDF's author only.
|
||||
|
||||
Links to files hosted elsewhere are perfectly acceptable. You could also look in ``tests/resources`` and see if any of those files reproduce your issue.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install -r requirements/main.txt -r requirements/test.txt .
|
||||
python -m pip install .[test]
|
||||
|
||||
- name: Report versions
|
||||
run: |
|
||||
@@ -124,7 +124,7 @@ jobs:
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -r requirements/main.txt -r requirements/test.txt .
|
||||
python -m pip install .[test]
|
||||
|
||||
- name: Report versions
|
||||
run: |
|
||||
@@ -174,7 +174,7 @@ jobs:
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -r requirements/main.txt -r requirements/test.txt .
|
||||
python -m pip install .[test]
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
|
||||
+2
-1
@@ -6,8 +6,9 @@
|
||||
!.gitattributes
|
||||
!.gitignore
|
||||
!.pre-commit-config.yaml
|
||||
!.readthedocs.yml
|
||||
!.readthedocs.yaml
|
||||
!.github/
|
||||
!.docker/
|
||||
|
||||
# Dev scratch
|
||||
*.ipynb
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
||||
# Optionally build your docs in additional formats such as PDF
|
||||
formats:
|
||||
- pdf
|
||||
|
||||
# Optionally set the version of Python and requirements required to build your docs
|
||||
python:
|
||||
version: 3.7
|
||||
install:
|
||||
- method: pip
|
||||
path: .
|
||||
extra_requirements:
|
||||
- docs
|
||||
@@ -1,10 +0,0 @@
|
||||
build:
|
||||
image: latest
|
||||
|
||||
python:
|
||||
version: 3.6
|
||||
|
||||
formats:
|
||||
- pdf
|
||||
|
||||
requirements_file: requirements/main.txt
|
||||
@@ -57,7 +57,7 @@ I searched the web for a free command line tool to OCR PDF files: I found many,
|
||||
|
||||
## Installation
|
||||
|
||||
Linux, Windows, macOS and FreeBSD are supported. Docker images are also available.
|
||||
Linux, Windows, macOS and FreeBSD are supported. Docker images are also available, for both x64 and ARM.
|
||||
|
||||
| Operating system | Install command |
|
||||
| ----------------------------- | ------------------------------|
|
||||
@@ -115,6 +115,7 @@ In addition to the required Python version (3.6+), OCRmyPDF requires external pr
|
||||
- [heise Open Source, 09/2014: Texterkennung mit OCRmyPDF](https://heise.de/-2356670)
|
||||
- [heise Durchsuchbare PDF-Dokumente mit OCRmyPDF erstellen](https://www.heise.de/ratgeber/Durchsuchbare-PDF-Dokumente-mit-OCRmyPDF-erstellen-4607592.html)
|
||||
- [Excellent Utilities: OCRmyPDF](https://www.linuxlinks.com/excellent-utilities-ocrmypdf-add-ocr-text-layer-scanned-pdfs/)
|
||||
- [LinuxUser Texterkennung mit OCRmyPDF und Scanbd automatisieren](https://www.linux-community.de/ausgaben/linuxuser/2021/06/texterkennung-mit-ocrmypdf-und-scanbd-automatisieren/)
|
||||
|
||||
## Business enquiries
|
||||
|
||||
|
||||
+2
-2
@@ -228,8 +228,8 @@ preprocessing is specified, then the image layer is a new PDF.
|
||||
Unlike ``sandwich`` this renderer is implemented within OCRmyPDF; anyone
|
||||
looking to customize how OCR is presented should look here. A major
|
||||
disadvantage of this renderer is it not capable of correctly handling
|
||||
text outside the Latin alphabet. Pull requests to improve the situation
|
||||
are welcome.
|
||||
text outside the Latin alphabet (specifically, it supports the ISO 8859-1
|
||||
character). Pull requests to improve the situation are welcome.
|
||||
|
||||
Currently, this renderer has the best compatibility with Mozilla's
|
||||
PDF.js viewer.
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ Users may need to customize the script to meet their requirements.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip3 install -r requirements/watcher.txt
|
||||
pip3 install ocrmypdf[watcher]
|
||||
|
||||
env OCR_INPUT_DIRECTORY=/mnt/input-pdfs \
|
||||
OCR_OUTPUT_DIRECTORY=/mnt/output-pdfs \
|
||||
|
||||
+3
-1
@@ -31,9 +31,11 @@
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ['sphinx.ext.napoleon']
|
||||
extensions = ['sphinx.ext.napoleon', 'sphinx_issues']
|
||||
|
||||
# Extension settings
|
||||
napoleon_use_rtype = False
|
||||
issues_github_path = "jbarlow83/OCRmyPDF"
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
@@ -812,8 +812,7 @@ To install all of the development and test requirements:
|
||||
python3 -m venv
|
||||
source venv/bin/activate
|
||||
cd OCRmyPDF
|
||||
pip install -e .
|
||||
pip install -r requirements/dev.txt -r requirements/test.txt
|
||||
pip install -e .[test]
|
||||
|
||||
To add JBIG2 encoding, see :ref:`jbig2`.
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ Limitations
|
||||
OCRmyPDF is limited by the Tesseract OCR engine. As such it experiences
|
||||
these limitations, as do any other programs that rely on Tesseract:
|
||||
|
||||
- The OCR is not as accurate as commercial solutions such as Abbyy.
|
||||
- The OCR is not as accurate as commercial OCR solutions.
|
||||
- It is not capable of recognizing handwriting.
|
||||
- It may find gibberish and report this as OCR output.
|
||||
- If a document contains languages outside of those given in the
|
||||
@@ -207,8 +207,9 @@ consider one of these similar open source programs:
|
||||
|
||||
- pdf2pdfocr
|
||||
- pdfsandwich
|
||||
- pypdfocr
|
||||
- pdfbeads
|
||||
|
||||
Ghostscript recently added three "pdfocr" output devices. They work by
|
||||
rasterizing all content and converting all pages to a single colour space.
|
||||
|
||||
Web front-ends
|
||||
==============
|
||||
|
||||
@@ -128,8 +128,9 @@ Commercial alternatives
|
||||
The author also provides professional services that include OCR and
|
||||
building databases around PDFs, and is happy to provide consultation.
|
||||
|
||||
Abbyy Cloud OCR is a viable commercial alternative with a web services
|
||||
API.
|
||||
Abbyy Cloud OCR is viable commercial alternative with a web services
|
||||
API. Amazon Textract, Google Cloud Vision, and Microsoft Azure
|
||||
Computer Vision provide advanced OCR but have less PDF rendering capability.
|
||||
|
||||
Password protection, digital signatures and certification
|
||||
=========================================================
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
|
||||
-->
|
||||
<!-- Title: Pipeline: Pages: 1 -->
|
||||
<svg width="1484pt" height="1277pt"
|
||||
viewBox="0.00 0.00 1484.00 1277.20" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 1273.1977)">
|
||||
<title>Pipeline:</title>
|
||||
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-1273.1977 1480,-1273.1977 1480,4 -4,4"/>
|
||||
<g id="clust1" class="cluster">
|
||||
<title>clustertasks</title>
|
||||
<polygon fill="none" stroke="#000000" points="8,-8 8,-1261.1977 1468,-1261.1977 1468,-8 8,-8"/>
|
||||
<text text-anchor="middle" x="738" y="-1233.1977" font-family="Times,serif" font-size="30.00" fill="#ff3232">Pipeline:</text>
|
||||
</g>
|
||||
<!-- t0 -->
|
||||
<g id="node1" class="node">
|
||||
<title>t0</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1215.7053,-1215.1977 1006.2947,-1215.1977 1002.2947,-1211.1977 1002.2947,-1179.1977 1211.7053,-1179.1977 1215.7053,-1183.1977 1215.7053,-1215.1977"/>
|
||||
<polyline fill="none" stroke="#000000" points="1211.7053,-1211.1977 1002.2947,-1211.1977 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1211.7053,-1211.1977 1211.7053,-1179.1977 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1211.7053,-1211.1977 1215.7053,-1215.1977 "/>
|
||||
<text text-anchor="middle" x="1109" y="-1191.1977" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.triage</text>
|
||||
</g>
|
||||
<!-- t1 -->
|
||||
<g id="node2" class="node">
|
||||
<title>t1</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1280.0433,-1157.1977 941.9567,-1157.1977 937.9567,-1153.1977 937.9567,-1121.1977 1276.0433,-1121.1977 1280.0433,-1125.1977 1280.0433,-1157.1977"/>
|
||||
<polyline fill="none" stroke="#000000" points="1276.0433,-1153.1977 937.9567,-1153.1977 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1276.0433,-1153.1977 1276.0433,-1121.1977 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1276.0433,-1153.1977 1280.0433,-1157.1977 "/>
|
||||
<text text-anchor="middle" x="1109" y="-1133.1977" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.repair_and_parse_pdf</text>
|
||||
</g>
|
||||
<!-- t0->t1 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>t0->t1</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1109,-1179.1641C1109,-1175.4895 1109,-1171.5395 1109,-1167.604"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1112.5001,-1167.4199 1109,-1157.4199 1105.5001,-1167.42 1112.5001,-1167.4199"/>
|
||||
</g>
|
||||
<!-- t2 -->
|
||||
<g id="node3" class="node">
|
||||
<title>t2</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1030.0926,-1078.2732 785,-1095.1731 539.9074,-1078.2732 540.1362,-1050.9285 1029.8638,-1050.9285 1030.0926,-1078.2732"/>
|
||||
<polygon fill="none" stroke="#000000" points="1034.1249,-1082.0021 785,-1099.1801 535.8751,-1082.0021 536.1685,-1046.931 1033.8315,-1046.931 1034.1249,-1082.0021"/>
|
||||
<text text-anchor="middle" x="785" y="-1064.7153" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.marker_pages</text>
|
||||
</g>
|
||||
<!-- t1->t2 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>t1->t2</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1023.449,-1121.1152C984.5695,-1112.8974 938.0675,-1103.0685 896.4957,-1094.2816"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="897.1066,-1090.8335 886.5989,-1092.1898 895.6589,-1097.6822 897.1066,-1090.8335"/>
|
||||
</g>
|
||||
<!-- t16 -->
|
||||
<g id="node17" class="node">
|
||||
<title>t16</title>
|
||||
<polygon fill="#00cc66" stroke="#000000" points="1215.5059,-328.1861 942.4941,-328.1861 938.4941,-324.1861 938.4941,-292.1861 1211.5059,-292.1861 1215.5059,-296.1861 1215.5059,-328.1861"/>
|
||||
<polyline fill="none" stroke="#000000" points="1211.5059,-324.1861 938.4941,-324.1861 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1211.5059,-324.1861 1211.5059,-292.1861 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1211.5059,-324.1861 1215.5059,-328.1861 "/>
|
||||
<text text-anchor="middle" x="1077" y="-304.1861" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.weave_layers</text>
|
||||
</g>
|
||||
<!-- t1->t16 -->
|
||||
<g id="edge24" class="edge">
|
||||
<title>t1->t16</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1097.2373,-1120.9576C1077.987,-1088.7184 1043.7317,-1019.7372 1063,-963.2656 1106.87,-834.6914 1482.8098,-573.3183 1409,-459.2656 1362.7595,-387.8137 1273.2613,-350.2799 1198.8305,-330.7528"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1199.4555,-327.3005 1188.9015,-328.2301 1197.7316,-334.0849 1199.4555,-327.3005"/>
|
||||
</g>
|
||||
<!-- t17 -->
|
||||
<g id="node18" class="node">
|
||||
<title>t17</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1439.5156,-1009.7492 1076.4844,-1009.7492 1072.4844,-1005.7492 1072.4844,-973.7492 1435.5156,-973.7492 1439.5156,-977.7492 1439.5156,-1009.7492"/>
|
||||
<polyline fill="none" stroke="#000000" points="1435.5156,-1005.7492 1072.4844,-1005.7492 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1435.5156,-1005.7492 1435.5156,-973.7492 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1435.5156,-1005.7492 1439.5156,-1009.7492 "/>
|
||||
<text text-anchor="middle" x="1256" y="-985.7492" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.generate_postscript_stub</text>
|
||||
</g>
|
||||
<!-- t1->t17 -->
|
||||
<g id="edge25" class="edge">
|
||||
<title>t1->t17</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1127.0251,-1121.1176C1153.0342,-1095.0292 1201.2007,-1046.7157 1230.7429,-1017.0834"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1233.2458,-1019.5302 1237.8275,-1009.9772 1228.2885,-1014.5879 1233.2458,-1019.5302"/>
|
||||
</g>
|
||||
<!-- t18 -->
|
||||
<g id="node19" class="node">
|
||||
<title>t18</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1070.189,-214.4288 1263,-187.1099 1455.811,-214.4288 1455.631,-258.6317 1070.369,-258.6317 1070.189,-214.4288"/>
|
||||
<polygon fill="none" stroke="#000000" points="1066.1715,-210.9543 1263,-183.0662 1459.8285,-210.9543 1459.6181,-262.6353 1066.3819,-262.6353 1066.1715,-210.9543"/>
|
||||
<text text-anchor="middle" x="1263" y="-220.6461" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.metadata_fixup</text>
|
||||
</g>
|
||||
<!-- t1->t18 -->
|
||||
<g id="edge28" class="edge">
|
||||
<title>t1->t18</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1241.1115,-1121.1192C1311.0076,-1105.2558 1393.5851,-1075.5895 1449,-1020.2329 1458.4922,-1010.7507 1459,-1005.1661 1459,-991.7492 1459,-991.7492 1459,-991.7492 1459,-393.7258 1459,-341.9727 1441.8377,-325.2216 1402,-292.1861 1390.9869,-283.0534 1378.4885,-274.871 1365.6104,-267.6415"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1367.1079,-264.4723 1356.6476,-262.7888 1363.775,-270.6279 1367.1079,-264.4723"/>
|
||||
</g>
|
||||
<!-- t3 -->
|
||||
<g id="node4" class="node">
|
||||
<title>t3</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1015.5194,-999.3074 785,-1016.2081 554.4806,-999.3074 554.6958,-971.9616 1015.3042,-971.9616 1015.5194,-999.3074"/>
|
||||
<polygon fill="none" stroke="#000000" points="1019.5491,-1003.0204 785,-1020.2165 550.4509,-1003.0204 550.7267,-967.9639 1019.2733,-967.9639 1019.5491,-1003.0204"/>
|
||||
<text text-anchor="middle" x="785" y="-985.7492" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.ocr_or_skip</text>
|
||||
</g>
|
||||
<!-- t2->t3 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>t2->t3</title>
|
||||
<path fill="none" stroke="#0044a0" d="M785,-1046.5938C785,-1041.5635 785,-1036.139 785,-1030.7273"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="788.5001,-1030.4427 785,-1020.4427 781.5001,-1030.4428 788.5001,-1030.4427"/>
|
||||
</g>
|
||||
<!-- t4 -->
|
||||
<g id="node5" class="node">
|
||||
<title>t4</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="889.3166,-941.2656 582.6834,-941.2656 578.6834,-937.2656 578.6834,-905.2656 885.3166,-905.2656 889.3166,-909.2656 889.3166,-941.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="885.3166,-937.2656 578.6834,-937.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="885.3166,-937.2656 885.3166,-905.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="885.3166,-937.2656 889.3166,-941.2656 "/>
|
||||
<text text-anchor="middle" x="734" y="-917.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.rasterize_preview</text>
|
||||
</g>
|
||||
<!-- t3->t4 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>t3->t4</title>
|
||||
<path fill="none" stroke="#0044a0" d="M767.1627,-967.797C762.8396,-961.9919 758.1927,-955.7519 753.7858,-949.8343"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="756.3465,-947.4129 747.5666,-941.483 750.7323,-951.5939 756.3465,-947.4129"/>
|
||||
</g>
|
||||
<!-- t5 -->
|
||||
<g id="node6" class="node">
|
||||
<title>t5</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1028.0824,-883.2656 769.9176,-883.2656 765.9176,-879.2656 765.9176,-847.2656 1024.0824,-847.2656 1028.0824,-851.2656 1028.0824,-883.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="1024.0824,-879.2656 765.9176,-879.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1024.0824,-879.2656 1024.0824,-847.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1024.0824,-879.2656 1028.0824,-883.2656 "/>
|
||||
<text text-anchor="middle" x="897" y="-859.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.orient_page</text>
|
||||
</g>
|
||||
<!-- t3->t5 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>t3->t5</title>
|
||||
<path fill="none" stroke="#0044a0" d="M869.1177,-967.8063C880.553,-961.0264 890.81,-952.3527 898,-941.2656 907.042,-927.3226 906.9457,-908.7053 904.5139,-893.387"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="907.914,-892.5383 902.5408,-883.4071 901.0469,-893.8961 907.914,-892.5383"/>
|
||||
</g>
|
||||
<!-- t4->t5 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>t4->t5</title>
|
||||
<path fill="none" stroke="#0044a0" d="M784.6807,-905.2319C801.0865,-899.3943 819.4462,-892.8614 836.4913,-886.7963"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="838.1026,-889.938 846.3506,-883.288 835.7559,-883.343 838.1026,-889.938"/>
|
||||
</g>
|
||||
<!-- t6 -->
|
||||
<g id="node7" class="node">
|
||||
<title>t6</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1064.7325,-825.2656 689.2675,-825.2656 685.2675,-821.2656 685.2675,-789.2656 1060.7325,-789.2656 1064.7325,-793.2656 1064.7325,-825.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="1060.7325,-821.2656 685.2675,-821.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1060.7325,-821.2656 1060.7325,-789.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1060.7325,-821.2656 1064.7325,-825.2656 "/>
|
||||
<text text-anchor="middle" x="875" y="-801.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.rasterize_with_ghostscript</text>
|
||||
</g>
|
||||
<!-- t5->t6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>t5->t6</title>
|
||||
<path fill="none" stroke="#0044a0" d="M890.1597,-847.2319C888.6839,-843.3412 887.0909,-839.1417 885.5115,-834.9776"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="888.731,-833.5965 881.9119,-825.4878 882.186,-836.0791 888.731,-833.5965"/>
|
||||
</g>
|
||||
<!-- t13 -->
|
||||
<g id="node16" class="node">
|
||||
<title>t13</title>
|
||||
<polygon fill="#00cc66" stroke="#000000" points="1077,-515.2656 754.4141,-487.2656 1077,-459.2656 1399.5859,-487.2656 1077,-515.2656"/>
|
||||
<text text-anchor="middle" x="1077" y="-481.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.select_image_layer</text>
|
||||
</g>
|
||||
<!-- t5->t13 -->
|
||||
<g id="edge20" class="edge">
|
||||
<title>t5->t13</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1000.2704,-847.241C1031.2359,-840.6873 1060.5415,-832.9862 1074,-825.2656 1114.0954,-802.2644 1145,-795.4899 1145,-749.2656 1145,-749.2656 1145,-749.2656 1145,-633.2656 1145,-590.368 1154.8687,-575.2844 1135,-537.2656 1131.571,-530.7041 1126.8893,-524.6314 1121.6622,-519.1451"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1123.8989,-516.4405 1114.2626,-512.0367 1119.0494,-521.4885 1123.8989,-516.4405"/>
|
||||
</g>
|
||||
<!-- t7 -->
|
||||
<g id="node8" class="node">
|
||||
<title>t7</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="856.0801,-767.2656 431.9199,-767.2656 427.9199,-763.2656 427.9199,-731.2656 852.0801,-731.2656 856.0801,-735.2656 856.0801,-767.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="852.0801,-763.2656 427.9199,-763.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="852.0801,-763.2656 852.0801,-731.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="852.0801,-763.2656 856.0801,-767.2656 "/>
|
||||
<text text-anchor="middle" x="642" y="-743.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.preprocess_remove_background</text>
|
||||
</g>
|
||||
<!-- t6->t7 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>t6->t7</title>
|
||||
<path fill="none" stroke="#0044a0" d="M802.5546,-789.2319C777.7884,-783.067 749.9071,-776.1266 724.4138,-769.7806"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="724.95,-766.3073 714.4006,-767.288 723.259,-773.1 724.95,-766.3073"/>
|
||||
</g>
|
||||
<!-- t12 -->
|
||||
<g id="node15" class="node">
|
||||
<title>t12</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="742,-593.2656 358.1874,-565.2656 742,-537.2656 1125.8126,-565.2656 742,-593.2656"/>
|
||||
<text text-anchor="middle" x="742" y="-559.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.select_visible_page_image</text>
|
||||
</g>
|
||||
<!-- t6->t12 -->
|
||||
<g id="edge18" class="edge">
|
||||
<title>t6->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M875.1443,-789.1129C874.6867,-773.2956 872.5831,-750.0189 865,-731.2656 844.2991,-680.0716 804.0126,-630.4165 775.1838,-598.9641"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="777.4937,-596.3085 768.1202,-591.3701 772.3682,-601.076 777.4937,-596.3085"/>
|
||||
</g>
|
||||
<!-- t8 -->
|
||||
<g id="node9" class="node">
|
||||
<title>t8</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="732.6759,-709.2656 413.3241,-709.2656 409.3241,-705.2656 409.3241,-673.2656 728.6759,-673.2656 732.6759,-677.2656 732.6759,-709.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="728.6759,-705.2656 409.3241,-705.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="728.6759,-705.2656 728.6759,-673.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="728.6759,-705.2656 732.6759,-709.2656 "/>
|
||||
<text text-anchor="middle" x="571" y="-685.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.preprocess_deskew</text>
|
||||
</g>
|
||||
<!-- t7->t8 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>t7->t8</title>
|
||||
<path fill="none" stroke="#0044a0" d="M619.9243,-731.2319C613.9709,-726.3685 607.4267,-721.0226 601.115,-715.8666"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="603.2653,-713.1037 593.3065,-709.4878 598.8367,-718.5248 603.2653,-713.1037"/>
|
||||
</g>
|
||||
<!-- t7->t12 -->
|
||||
<g id="edge17" class="edge">
|
||||
<title>t7->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M717.0346,-731.1646C726.8757,-725.6884 735.7103,-718.5557 742,-709.2656 763.0291,-678.205 759.4083,-634.0888 752.8082,-602.8898"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="756.1481,-601.7976 750.487,-592.842 749.3278,-603.3733 756.1481,-601.7976"/>
|
||||
</g>
|
||||
<!-- t9 -->
|
||||
<g id="node10" class="node">
|
||||
<title>t9</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="712.8828,-651.2656 411.1172,-651.2656 407.1172,-647.2656 407.1172,-615.2656 708.8828,-615.2656 712.8828,-619.2656 712.8828,-651.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="708.8828,-647.2656 407.1172,-647.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="708.8828,-647.2656 708.8828,-615.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="708.8828,-647.2656 712.8828,-651.2656 "/>
|
||||
<text text-anchor="middle" x="560" y="-627.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.preprocess_clean</text>
|
||||
</g>
|
||||
<!-- t8->t9 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>t8->t9</title>
|
||||
<path fill="none" stroke="#0044a0" d="M567.5798,-673.2319C566.8624,-669.4493 566.0897,-665.3747 565.3216,-661.3247"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="568.7581,-660.6605 563.4559,-651.4878 561.8807,-661.9649 568.7581,-660.6605"/>
|
||||
</g>
|
||||
<!-- t8->t12 -->
|
||||
<g id="edge16" class="edge">
|
||||
<title>t8->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M670.0045,-673.2618C693.2528,-667.2338 713.6919,-659.8307 722,-651.2656 734.1971,-638.6912 739.4901,-620.2051 741.6123,-603.5914"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="745.1041,-603.8427 742.5574,-593.5585 738.1349,-603.1862 745.1041,-603.8427"/>
|
||||
</g>
|
||||
<!-- t10 -->
|
||||
<g id="node11" class="node">
|
||||
<title>t10</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="340.1094,-583.2656 35.8906,-583.2656 31.8906,-579.2656 31.8906,-547.2656 336.1094,-547.2656 340.1094,-551.2656 340.1094,-583.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="336.1094,-579.2656 31.8906,-579.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="336.1094,-579.2656 336.1094,-547.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="336.1094,-579.2656 340.1094,-583.2656 "/>
|
||||
<text text-anchor="middle" x="186" y="-559.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.select_ocr_image</text>
|
||||
</g>
|
||||
<!-- t9->t10 -->
|
||||
<g id="edge11" class="edge">
|
||||
<title>t9->t10</title>
|
||||
<path fill="none" stroke="#0044a0" d="M460.7568,-615.2213C409.7279,-605.9434 347.4237,-594.6153 295.0537,-585.0935"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="295.5223,-581.6214 285.0575,-583.276 294.2701,-588.5085 295.5223,-581.6214"/>
|
||||
</g>
|
||||
<!-- t9->t12 -->
|
||||
<g id="edge15" class="edge">
|
||||
<title>t9->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M608.2948,-615.2213C627.0226,-608.2242 648.8712,-600.0609 669.4134,-592.3859"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="670.9148,-595.5613 679.0573,-588.7826 668.4648,-589.004 670.9148,-595.5613"/>
|
||||
</g>
|
||||
<!-- t11 -->
|
||||
<g id="node12" class="node">
|
||||
<title>t11</title>
|
||||
<polygon fill="#00cc66" stroke="#000000" points="334.0996,-505.2656 19.9004,-505.2656 15.9004,-501.2656 15.9004,-469.2656 330.0996,-469.2656 334.0996,-473.2656 334.0996,-505.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="330.0996,-501.2656 15.9004,-501.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="330.0996,-501.2656 330.0996,-469.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="330.0996,-501.2656 334.0996,-505.2656 "/>
|
||||
<text text-anchor="middle" x="175" y="-481.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.ocr_tesseract_hocr</text>
|
||||
</g>
|
||||
<!-- t10->t11 -->
|
||||
<g id="edge12" class="edge">
|
||||
<title>t10->t11</title>
|
||||
<path fill="none" stroke="#0044a0" d="M183.4487,-547.1748C182.1254,-537.7914 180.4788,-526.1154 178.9917,-515.5701"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="182.4378,-514.9417 177.5755,-505.5285 175.5064,-515.9193 182.4378,-514.9417"/>
|
||||
</g>
|
||||
<!-- t15 -->
|
||||
<g id="node14" class="node">
|
||||
<title>t15</title>
|
||||
<polygon fill="#ff69b4" stroke="#000000" points="736.2696,-505.2656 355.7304,-505.2656 351.7304,-501.2656 351.7304,-469.2656 732.2696,-469.2656 736.2696,-473.2656 736.2696,-505.2656"/>
|
||||
<polyline fill="none" stroke="#000000" points="732.2696,-501.2656 351.7304,-501.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="732.2696,-501.2656 732.2696,-469.2656 "/>
|
||||
<polyline fill="none" stroke="#000000" points="732.2696,-501.2656 736.2696,-505.2656 "/>
|
||||
<text text-anchor="middle" x="544" y="-481.2656" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.ocr_tesseract_textonly_pdf</text>
|
||||
</g>
|
||||
<!-- t10->t15 -->
|
||||
<g id="edge14" class="edge">
|
||||
<title>t10->t15</title>
|
||||
<path fill="none" stroke="#0044a0" d="M269.0322,-547.1748C323.4947,-535.3086 394.7854,-519.776 451.1284,-507.5002"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="452.0829,-510.8744 461.1086,-505.3257 450.5927,-504.0348 452.0829,-510.8744"/>
|
||||
</g>
|
||||
<!-- t14 -->
|
||||
<g id="node13" class="node">
|
||||
<title>t14</title>
|
||||
<polygon fill="#00cc66" stroke="#000000" points="330.0433,-411.7258 21.9567,-411.7258 17.9567,-407.7258 17.9567,-375.7258 326.0433,-375.7258 330.0433,-379.7258 330.0433,-411.7258"/>
|
||||
<polyline fill="none" stroke="#000000" points="326.0433,-407.7258 17.9567,-407.7258 "/>
|
||||
<polyline fill="none" stroke="#000000" points="326.0433,-407.7258 326.0433,-375.7258 "/>
|
||||
<polyline fill="none" stroke="#000000" points="326.0433,-407.7258 330.0433,-411.7258 "/>
|
||||
<text text-anchor="middle" x="174" y="-387.7258" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.render_hocr_page</text>
|
||||
</g>
|
||||
<!-- t11->t14 -->
|
||||
<g id="edge13" class="edge">
|
||||
<title>t11->t14</title>
|
||||
<path fill="none" stroke="#0044a0" d="M174.8072,-469.2302C174.6642,-455.8584 174.4666,-437.3702 174.3027,-422.0357"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="177.8024,-421.987 174.1956,-412.025 170.8028,-422.0619 177.8024,-421.987"/>
|
||||
</g>
|
||||
<!-- t19 -->
|
||||
<g id="node22" class="node">
|
||||
<title>t19</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="351.7205,-381.5085 545,-354.1897 738.2795,-381.5085 738.0991,-425.7112 351.9009,-425.7112 351.7205,-381.5085"/>
|
||||
<polygon fill="none" stroke="#000000" points="347.7033,-378.0329 545,-350.1463 742.2967,-378.0329 742.0858,-429.7148 347.9142,-429.7148 347.7033,-378.0329"/>
|
||||
<text text-anchor="middle" x="545" y="-387.7258" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.merge_sidecars</text>
|
||||
</g>
|
||||
<!-- t11->t19 -->
|
||||
<g id="edge32" class="edge">
|
||||
<title>t11->t19</title>
|
||||
<path fill="none" stroke="#0044a0" d="M246.3397,-469.2302C287.966,-458.7066 342.1269,-445.0142 392.8772,-432.184"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="393.8058,-435.5594 402.6429,-429.7151 392.0901,-428.773 393.8058,-435.5594"/>
|
||||
</g>
|
||||
<!-- t14->t16 -->
|
||||
<g id="edge22" class="edge">
|
||||
<title>t14->t16</title>
|
||||
<path fill="none" stroke="#0044a0" d="M230.6615,-375.7128C262.2207,-366.4581 302.4172,-355.9425 339,-350.1861 448.3957,-332.9725 745.7869,-320.7866 927.9215,-314.6743"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="928.248,-318.1655 938.1258,-314.3342 928.0148,-311.1693 928.248,-318.1655"/>
|
||||
</g>
|
||||
<!-- t15->t16 -->
|
||||
<g id="edge21" class="edge">
|
||||
<title>t15->t16</title>
|
||||
<path fill="none" stroke="#0044a0" d="M630.0636,-469.2083C667.5329,-460.6467 711.76,-449.5912 751,-437.2656 850.4985,-406.0121 963.1653,-359.5222 1026.586,-332.2894"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1028.1566,-335.4238 1035.9553,-328.2523 1025.3866,-328.9951 1028.1566,-335.4238"/>
|
||||
</g>
|
||||
<!-- t15->t19 -->
|
||||
<g id="edge31" class="edge">
|
||||
<title>t15->t19</title>
|
||||
<path fill="none" stroke="#0044a0" d="M544.1928,-469.2302C544.2822,-460.8687 544.393,-450.5066 544.5035,-440.166"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="548.006,-439.9443 544.6132,-429.9075 541.0064,-439.8694 548.006,-439.9443"/>
|
||||
</g>
|
||||
<!-- t12->t13 -->
|
||||
<g id="edge19" class="edge">
|
||||
<title>t12->t13</title>
|
||||
<path fill="none" stroke="#0044a0" d="M833.9833,-543.8486C879.0975,-533.3444 933.4556,-520.6879 979.3116,-510.0109"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="980.3156,-513.3709 989.2614,-507.6943 978.7282,-506.5532 980.3156,-513.3709"/>
|
||||
</g>
|
||||
<!-- t13->t16 -->
|
||||
<g id="edge23" class="edge">
|
||||
<title>t13->t16</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1077,-459.2068C1077,-426.2624 1077,-371.9187 1077,-338.7552"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1080.5001,-338.3818 1077,-328.3819 1073.5001,-338.3819 1080.5001,-338.3818"/>
|
||||
</g>
|
||||
<!-- t16->t18 -->
|
||||
<g id="edge27" class="edge">
|
||||
<title>t16->t18</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1117.3592,-292.0592C1133.8695,-284.6437 1153.6803,-275.7459 1173.2953,-266.9361"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1174.8979,-270.0531 1182.586,-262.7632 1172.0299,-263.6676 1174.8979,-270.0531"/>
|
||||
</g>
|
||||
<!-- t17->t18 -->
|
||||
<g id="edge26" class="edge">
|
||||
<title>t17->t18</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1326.2292,-973.7283C1377.8362,-955.768 1439,-922.4247 1439,-865.2656 1439,-865.2656 1439,-865.2656 1439,-393.7258 1439,-338.7092 1393.2056,-296.3464 1348.3356,-268.0433"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1350.0403,-264.9831 1339.6842,-262.7465 1346.3852,-270.9531 1350.0403,-264.9831"/>
|
||||
</g>
|
||||
<!-- t20 -->
|
||||
<g id="node20" class="node">
|
||||
<title>t20</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1400.3184,-161.1062 1129.6816,-161.1062 1125.6816,-157.1062 1125.6816,-125.1062 1396.3184,-125.1062 1400.3184,-129.1062 1400.3184,-161.1062"/>
|
||||
<polyline fill="none" stroke="#000000" points="1396.3184,-157.1062 1125.6816,-157.1062 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1396.3184,-157.1062 1396.3184,-125.1062 "/>
|
||||
<polyline fill="none" stroke="#000000" points="1396.3184,-157.1062 1400.3184,-161.1062 "/>
|
||||
<text text-anchor="middle" x="1263" y="-137.1062" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.optimize_pdf</text>
|
||||
</g>
|
||||
<!-- t18->t20 -->
|
||||
<g id="edge29" class="edge">
|
||||
<title>t18->t20</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1263,-182.9188C1263,-179.129 1263,-175.3607 1263,-171.739"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1266.5001,-171.4394 1263,-161.4394 1259.5001,-171.4394 1266.5001,-171.4394"/>
|
||||
</g>
|
||||
<!-- t21 -->
|
||||
<g id="node21" class="node">
|
||||
<title>t21</title>
|
||||
<polygon fill="#efa03b" stroke="#000000" points="1096.0652,-47.332 1263,-20.0049 1429.9348,-47.332 1429.779,-91.5483 1096.221,-91.5483 1096.0652,-47.332"/>
|
||||
<polygon fill="none" stroke="#000000" points="1092.0538,-43.9306 1263,-15.9468 1433.9462,-43.9306 1433.7643,-95.5532 1092.2357,-95.5532 1092.0538,-43.9306"/>
|
||||
<text text-anchor="middle" x="1263" y="-53.5531" font-family="Times,serif" font-size="20.00" fill="#000000">ocrmypdf.pipeline.copy_final</text>
|
||||
</g>
|
||||
<!-- t20->t21 -->
|
||||
<g id="edge30" class="edge">
|
||||
<title>t20->t21</title>
|
||||
<path fill="none" stroke="#0044a0" d="M1263,-124.9764C1263,-119.37 1263,-112.9163 1263,-106.2938"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="1266.5001,-105.8456 1263,-95.8457 1259.5001,-105.8457 1266.5001,-105.8456"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 25 KiB |
+10
-2
@@ -61,9 +61,10 @@ similar to ``pytest`` packages such as ``pytest-cov`` (the package) and
|
||||
|
||||
.. note::
|
||||
|
||||
We strongly recommend plugin authors name their plugins with the prefix
|
||||
We recommend plugin authors name their plugins with the prefix
|
||||
``ocrmypdf-`` (for the package name on PyPI) and ``ocrmypdf_`` (for the
|
||||
module), just like pytest plugins.
|
||||
module), just like pytest plugins. At the same time, please make it clear
|
||||
that your package is not official.
|
||||
|
||||
Setuptools plugins
|
||||
==================
|
||||
@@ -86,6 +87,13 @@ named ``ocrmypdf-exampleplugin``:
|
||||
entry_points={"ocrmypdf": ["exampleplugin = exampleplugin.pluginmodule"]},
|
||||
)
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
# equivalent setup.cfg
|
||||
[options.entry_points]
|
||||
ocrmypdf =
|
||||
exampleplugin = exampleplugin.pluginmodule
|
||||
|
||||
Plugin requirements
|
||||
===================
|
||||
|
||||
|
||||
+138
-138
@@ -13,18 +13,44 @@ The public API may be useful in scripts that launch OCRmyPDF processes or that
|
||||
wish to use some of its features for working with PDFs.
|
||||
|
||||
|
||||
v12.2.0
|
||||
=======
|
||||
|
||||
- Fixed invalid Tesseract version number on Windows (:issue:`795`).
|
||||
- Documentation tweaks. Documentation build now depends on sphinx-issues package.
|
||||
|
||||
v12.1.0
|
||||
=======
|
||||
|
||||
- For security reasons we now require Pillow >= 8.2.x. (Older versions will continue
|
||||
to work if upgrading is not an option.)
|
||||
- The build system was reorganized to rely on ``setup.cfg`` instead of ``setup.py``.
|
||||
All changes should work with previously supported versions of setuptools.
|
||||
- The files in ``requirements/*`` are now considered deprecated but will be retained for v12.
|
||||
Instead use ``pip install ocrmypdf[test]`` instead of ``requirements/test.txt``, etc.
|
||||
These files will be removed in v13.
|
||||
|
||||
v12.0.3
|
||||
=======
|
||||
|
||||
- Expand the list of languages supported by the hocr PDF renderer.
|
||||
Several languages were previously considered not supported, particularly those
|
||||
non-European languages that use the Latin alphabet.
|
||||
- Fixed a case where the exception stack trace was suppressed in verbose mode.
|
||||
- Improved documentation around commercial OCR.
|
||||
|
||||
v12.0.2
|
||||
=======
|
||||
|
||||
- Fix exception thrown when using ``--remove-background`` on files containing small
|
||||
images (#769).
|
||||
- Fixed exception thrown when using ``--remove-background`` on files containing small
|
||||
images (:issue:`769`).
|
||||
- Improve documentation for description of adding language packs to the Docker image
|
||||
and corrected name of French language pack.
|
||||
and corrected name of French language pack.
|
||||
|
||||
v12.0.1
|
||||
=======
|
||||
|
||||
- Fix "invalid version number" for untagged tesseract versions (#770).
|
||||
- Fixed "invalid version number" for untagged tesseract versions (:issue:`770`).
|
||||
|
||||
v12.0.0
|
||||
=======
|
||||
@@ -84,7 +110,7 @@ v12.0.0
|
||||
which ships with Ubuntu 18.04).
|
||||
- OCRmyPDF can now parse all of Tesseract version numbers, since several
|
||||
schemes have been in use.
|
||||
- Fixed an issue with parsing PDFs that contain images drawn at a scale of 0. (#761)
|
||||
- Fixed an issue with parsing PDFs that contain images drawn at a scale of 0. (:issue:`761`)
|
||||
- Removed a frequently repeated message about disabling mmap.
|
||||
|
||||
v11.7.3
|
||||
@@ -114,7 +140,7 @@ v11.7.0
|
||||
=======
|
||||
|
||||
- We now support using ``--sidecar`` in conjunction with ``--pages``; these arguments
|
||||
used to be mutually exclusive. (#735)
|
||||
used to be mutually exclusive. (:issue:`735`)
|
||||
- Fixed a possible issue with PDF/A-1b generation. Acrobat complained that our PDFs use
|
||||
object streams. More robust PDF/A validators like veraPDF don't consider this a
|
||||
problem, but we'll honor Acrobat's objection from here on. This may increase file
|
||||
@@ -124,13 +150,13 @@ v11.6.2
|
||||
=======
|
||||
|
||||
- Fixed a regression where the wrong page orientation would be produced when using
|
||||
arguments such as ``--deskew --rotate-pages`` (#730).
|
||||
arguments such as ``--deskew --rotate-pages`` (:issue:`730`).
|
||||
|
||||
v11.6.1
|
||||
=======
|
||||
|
||||
- Fixed an issue with attempting optimize unusually narrow-width images by excluding
|
||||
these images from optimization (#732).
|
||||
these images from optimization (:issue:`732`).
|
||||
- Remove an obsolete compatibility shim for a version of pikepdf that is no longer
|
||||
supported.
|
||||
|
||||
@@ -168,7 +194,7 @@ v11.4.5
|
||||
v11.4.4
|
||||
=======
|
||||
|
||||
- Fixed ``AttributeError: 'NoneType' object has no attribute 'userunit'``, issue #700,
|
||||
- Fixed ``AttributeError: 'NoneType' object has no attribute 'userunit'`` (:issue:`700`),
|
||||
related to OCRmyPDF not properly forwarded an error message from pdfminer.six.
|
||||
- Adjusted typing of some arguments.
|
||||
- ``ocrmypdf.ocr`` now takes a ``threading.Lock`` for reasons outlined in the
|
||||
@@ -211,7 +237,7 @@ v11.4.0
|
||||
``com.github.ocrmypdf`` to ``ocrmypdf.io``. Scripts that chose to depend on this
|
||||
prefix may need to be adjusted. (This has always been an implementation detail so is
|
||||
not considered part of the semantic versioning "contract".)
|
||||
- Fixed issue #692, where a particular file with malformed fonts would flood an
|
||||
- Fixed :issue:`692`, where a particular file with malformed fonts would flood an
|
||||
internal message cue by generating so many debug messages.
|
||||
- Fixed an exception on processing hOCR files with no page record. Tesseract
|
||||
is not known to generate such files.
|
||||
@@ -230,7 +256,7 @@ v11.3.3
|
||||
=======
|
||||
|
||||
- If unpaper outputs non-UTF-8 data, quietly fix this rather than choke on the
|
||||
conversion. (Possibly addresses #671.)
|
||||
conversion. (Possibly addresses :issue:`671`.)
|
||||
|
||||
v11.3.2
|
||||
=======
|
||||
@@ -243,7 +269,7 @@ v11.3.2
|
||||
as optimization candidates.
|
||||
- On some systems, unpaper seems to be unable to process the PNGs we offer it
|
||||
as input. We now convert the input to PNM format, which unpaper always accepts.
|
||||
Fixes #665 and #667.
|
||||
Fixes :issue:`665` and :issue:`667`.
|
||||
- DPI sent to unpaper is now rounded to a more reasonable number of decimal digits.
|
||||
- Debug and error messages from unpaper were being suppressed.
|
||||
- Some documentation tweaks.
|
||||
@@ -252,7 +278,7 @@ v11.3.1
|
||||
=======
|
||||
|
||||
- Declare support for new versions: pdfminer.six 20201018 and pikepdf 2.x
|
||||
- Fix warning related to ``--pdfa-image-compression`` that appears at the wrong
|
||||
- Fixed warning related to ``--pdfa-image-compression`` that appears at the wrong
|
||||
time.
|
||||
|
||||
v11.3.0
|
||||
@@ -272,7 +298,7 @@ v11.3.0
|
||||
macOS and Windows only where the parent process is not forked.
|
||||
- Fixed the hookspec of rasterize_pdf_page to remove default parameters that
|
||||
were not handled in an expected way by pluggy.
|
||||
- Fixed another issue with automatic page rotation (#658) due to the issue above.
|
||||
- Fixed another issue with automatic page rotation (:issue:`658`) due to the issue above.
|
||||
|
||||
v11.2.1
|
||||
=======
|
||||
@@ -294,7 +320,7 @@ v11.1.2
|
||||
- Fixed hOCR renderer writing the text in roughly reverse order. This should not
|
||||
affect reasonably smart PDF readers that properly locate the position of all
|
||||
text, but may confuse those that rely on the order of objects in the content
|
||||
stream. (#642)
|
||||
stream. (:issue:`642`)
|
||||
|
||||
v11.1.1
|
||||
=======
|
||||
@@ -307,9 +333,9 @@ v11.1.1
|
||||
v11.1.0
|
||||
=======
|
||||
|
||||
- Fixed page rotation issues: #634, #589.
|
||||
- Fixed page rotation issues: :issue:`634,589`.
|
||||
- Fixed some cases where optimization created an invalid image such as a
|
||||
1-bit "RGB" image: #629, #620.
|
||||
1-bit "RGB" image: :issue:`629,620`.
|
||||
- Page numbers are now displayed in debug logs when pages are being grafted.
|
||||
- ocrmypdf.optimize.rewrite_png and ocrmypdf.optimize.rewrite_png_as_g4 were
|
||||
marked deprecated. Strictly speaking these should have been internal APIs,
|
||||
@@ -322,7 +348,7 @@ v11.1.0
|
||||
v11.0.2
|
||||
=======
|
||||
|
||||
- Fixed issue #612, TypeError exception. Fixed by eliminating unnecessary repair of
|
||||
- Fixed :issue:`612`, TypeError exception. Fixed by eliminating unnecessary repair of
|
||||
input PDF metadata in memory.
|
||||
|
||||
v11.0.1
|
||||
@@ -339,7 +365,7 @@ v11.0.0
|
||||
- Project license changed to Mozilla Public License 2.0. Some miscellaneous
|
||||
code is now under MIT license and non-code content/media remains under
|
||||
CC-BY-SA 4.0. License changed with approval of all people who were found
|
||||
to have contributed to GPLv3 licensed sections of the project. (#600)
|
||||
to have contributed to GPLv3 licensed sections of the project. (:issue:`600`)
|
||||
- Because the license changed, this is being treated as a major version number
|
||||
change; however, there are no known breaking changes in functional behavior
|
||||
or API compared to v10.x.
|
||||
@@ -348,7 +374,7 @@ v10.3.3
|
||||
=======
|
||||
|
||||
- Fixed a "KeyError: 'dpi'" error message when using ``--threshold`` on an image.
|
||||
(#607)
|
||||
(:issue:`607`)
|
||||
|
||||
v10.3.2
|
||||
=======
|
||||
@@ -391,16 +417,16 @@ v10.2.0
|
||||
=======
|
||||
|
||||
- Update Docker image to use Ubuntu 20.04.
|
||||
- Fixed issue PDF/A acquires title "Untitled" after conversion. (#582)
|
||||
- Fixed issue PDF/A acquires title "Untitled" after conversion. (:issue:`582`)
|
||||
- Fixed a problem where, when using ``--pdf-renderer hocr``, some text would
|
||||
be missing from the output when using a more recent version of Tesseract.
|
||||
Tesseract began adding more detailed markup about the semantics of text
|
||||
that our HOCR transform did not recognize, so it ignored them. This option is
|
||||
not the default. If necessary ``--redo-ocr`` also redoing OCR to fix such issues.
|
||||
- Fixed an error in Python 3.9 beta, due to removal of deprecated
|
||||
``Element.getchildren()``. (#584)
|
||||
``Element.getchildren()``. (:issue:`584`)
|
||||
- Implemented support using the API with ``BytesIO`` and other file stream objects.
|
||||
(#545)
|
||||
(:issue:`545`)
|
||||
|
||||
v10.1.1
|
||||
=======
|
||||
@@ -493,7 +519,7 @@ v9.8.0
|
||||
|
||||
- Fixed issue where only the first PNG (FlateDecode) image in a file would be
|
||||
considered for optimization. File sizes should be improved from here on.
|
||||
- Fixed a startup crash when the chosen language was Japanese (#543).
|
||||
- Fixed a startup crash when the chosen language was Japanese (:issue:`543`).
|
||||
- Added options to configure polling and log level to watcher.py.
|
||||
|
||||
v9.7.2
|
||||
@@ -540,11 +566,11 @@ v9.6.1
|
||||
they can be copied out as whole files, and to ensure syntax checking
|
||||
is maintained.
|
||||
|
||||
- Fixed an error that caused bash completions to fail on macOS. (#502, #504;
|
||||
- Fixed an error that caused bash completions to fail on macOS. (:issue:`502,504`;
|
||||
@AlexanderWillner)
|
||||
- Fixed a rare case where OCRmyPDF threw an exception while processing a PDF
|
||||
with the wrong object type in its ``/Trailer /Info``. The error is now logged
|
||||
and incorrect object is ignored. (#497)
|
||||
and incorrect object is ignored. (:issue:`497`)
|
||||
- Removed potentially non-free file ``enron1.pdf`` and simplified the test that
|
||||
used it.
|
||||
- Removed potentially non-free file ``misc/media/logo.afdesign``.
|
||||
@@ -746,7 +772,7 @@ v8.3.1
|
||||
======
|
||||
|
||||
- Fixed an issue where PDFs with malformed metadata would be rendered as
|
||||
blank pages. `#398 <https://github.com/jbarlow83/OCRmyPDF/issues/398>`_.
|
||||
blank pages. :issue:`398`.
|
||||
|
||||
v8.3.0
|
||||
======
|
||||
@@ -829,7 +855,7 @@ v8.2.0
|
||||
designed. However, quality would not be impacted. Lossless JBIG2 was
|
||||
entirely unaffected.
|
||||
- Updated dependencies, including pikepdf to 1.1.0. This fixes
|
||||
`#358 <https://github.com/jbarlow83/OCRmyPDF/issues/358>`__.
|
||||
:issue:`358`.
|
||||
- The install-time version checks for certain external programs have
|
||||
been removed from setup.py. These tests are now performed at
|
||||
run-time.
|
||||
@@ -850,7 +876,7 @@ v8.1.0
|
||||
(specifically, those with invalid destination objects)
|
||||
- Fixed an issue when using ``--tesseract-timeout`` and image
|
||||
processing features on a file with more than 100 pages.
|
||||
`#347 <https://github.com/jbarlow83/OCRmyPDF/issues/347>`__
|
||||
:issue:`347`
|
||||
- OCRmyPDF now always calls ``os.nice(5)`` to signal to operating
|
||||
systems that it is a background process.
|
||||
|
||||
@@ -858,7 +884,7 @@ v8.0.1
|
||||
======
|
||||
|
||||
- Fixed an exception when parsing PDFs that are missing a required
|
||||
field. `#325 <https://github.com/jbarlow83/OCRmyPDF/issues/325>`__
|
||||
field. :issue:`325`
|
||||
- pikepdf 1.0.5 is now required, to address some other PDF parsing
|
||||
issues.
|
||||
|
||||
@@ -879,7 +905,7 @@ older versions of certain dependencies.
|
||||
**Other changes**
|
||||
|
||||
- Fixed an unhandled exception when attempting to mask barcodes.
|
||||
`#322 <https://github.com/jbarlow83/OCRmyPDF/issues/322>`__
|
||||
:issue:`322`
|
||||
- It is now possible to use ocrmypdf without pdfminer.six, to support
|
||||
distributions that do not have it or cannot currently use it (e.g.
|
||||
Homebrew). Downstream maintainers should include pdfminer.six if
|
||||
@@ -906,13 +932,13 @@ v7.4.0
|
||||
- chardet >= 3.0.4 is temporarily listed as required. pdfminer.six
|
||||
depends on it, but the most recent release does not specify this
|
||||
requirement.
|
||||
(`#326 <https://github.com/jbarlow83/OCRmyPDF/issues/326>`__)
|
||||
(:issue:`326`)
|
||||
- python-xmp-toolkit and libexempi are no longer required.
|
||||
- A new Docker image is now being provided for users who wish to access
|
||||
OCRmyPDF over a simple HTTP interface, instead of the command line.
|
||||
- Increase tolerance of PDFs that overflow or underflow the PDF
|
||||
graphics stack.
|
||||
(`#325 <https://github.com/jbarlow83/OCRmyPDF/issues/325>`__)
|
||||
(:issue:`325`)
|
||||
|
||||
v7.3.1
|
||||
======
|
||||
@@ -986,7 +1012,7 @@ v7.3.0
|
||||
v7.2.1
|
||||
======
|
||||
|
||||
- Fix compatibility with an API change in pikepdf 0.3.5.
|
||||
- Fixed compatibility with an API change in pikepdf 0.3.5.
|
||||
- A kludge to support Leptonica versions older than 1.72 in the test
|
||||
suite was dropped. Older versions of Leptonica are likely still
|
||||
compatible. The only impact is that a portion of the test suite will
|
||||
@@ -1023,7 +1049,7 @@ Users who did not install an optional JBIG2 encoder are unaffected.
|
||||
will now attempt to further optimize that image as CCITT or JBIG2,
|
||||
instead of keeping it in the "flate" encoding which is not efficient
|
||||
for 1 bpp images.
|
||||
(`#297 <https://github.com/jbarlow83/OCRmyPDF/issues/297>`__)
|
||||
(:issue:`297`)
|
||||
- Images in PDFs that are used as soft masks (i.e. transparency masks
|
||||
or alpha channels) are now excluded from optimization.
|
||||
- Fixed handling of Tesseract 4.0-rc1 which now accepts invalid
|
||||
@@ -1035,15 +1061,14 @@ v7.1.0
|
||||
- Improve the performance of initial text extraction, which is done to
|
||||
determine if a file contains existing text of some kind or not. On
|
||||
large files, this initial processing is now about 20x times faster.
|
||||
(`#299 <https://github.com/jbarlow83/OCRmyPDF/issues/299>`__)
|
||||
(:issue:`299`)
|
||||
- pikepdf 0.3.3 is now required.
|
||||
- Fixed issue
|
||||
`#231 <https://github.com/jbarlow83/OCRmyPDF/issues/231>`__, a
|
||||
- Fixed :issue:`231`, a
|
||||
problem with JPEG2000 images where image metadata was only available
|
||||
inside the JPEG2000 file.
|
||||
- Fixed some additional Ghostscript 9.25 compatibility issues.
|
||||
- Improved handling of KeyboardInterrupt error messages.
|
||||
(`#301 <https://github.com/jbarlow83/OCRmyPDF/issues/301>`__)
|
||||
(:issue:`301`)
|
||||
- README.md is now served in GitHub markdown instead of
|
||||
reStructuredText.
|
||||
|
||||
@@ -1075,35 +1100,34 @@ v7.0.5
|
||||
v7.0.4
|
||||
======
|
||||
|
||||
- Fix exception thrown when trying to optimize a certain type of PNG
|
||||
- Fixed exception thrown when trying to optimize a certain type of PNG
|
||||
embedded in a PDF with the ``-O2``
|
||||
- Update to pikepdf 0.3.2, to gain support for optimizing some
|
||||
additional image types that were previously excluded from
|
||||
optimization (CMYK and grayscale). Fixes
|
||||
`#285 <https://github.com/jbarlow83/OCRmyPDF/issues/285>`__.
|
||||
:issue:`285`.
|
||||
|
||||
v7.0.3
|
||||
======
|
||||
|
||||
- Fix issue
|
||||
`#284 <https://github.com/jbarlow83/OCRmyPDF/issues/284>`__, an error
|
||||
- Fixed :issue:`284`, an error
|
||||
when parsing inline images that have are also image masks, by
|
||||
upgrading pikepdf to 0.3.1
|
||||
|
||||
v7.0.2
|
||||
======
|
||||
|
||||
- Fix a regression with ``--rotate-pages`` on pages that already had
|
||||
- Fixed a regression with ``--rotate-pages`` on pages that already had
|
||||
rotations applied.
|
||||
(`#279 <https://github.com/jbarlow83/OCRmyPDF/issues/279>`__)
|
||||
(:issue:`279`)
|
||||
- Improve quality of page rotation in some cases by rasterizing a
|
||||
higher quality preview image.
|
||||
(`#281 <https://github.com/jbarlow83/OCRmyPDF/issues/281>`__)
|
||||
(:issue:`281`)
|
||||
|
||||
v7.0.1
|
||||
======
|
||||
|
||||
- Fix compatibility with img2pdf >= 0.3.0 by rejecting input images
|
||||
- Fixed compatibility with img2pdf >= 0.3.0 by rejecting input images
|
||||
that have an alpha channel
|
||||
- Add forward compatibility for pikepdf 0.3.0 (unrelated to img2pdf)
|
||||
- Various documentation updates for v7.0.0 changes
|
||||
@@ -1206,7 +1230,7 @@ v6.2.4
|
||||
v6.2.3
|
||||
======
|
||||
|
||||
- Fix compatibility with img2pdf >= 0.3.0 by rejecting input images
|
||||
- Fixed compatibility with img2pdf >= 0.3.0 by rejecting input images
|
||||
that have an alpha channel
|
||||
- This version will be included in Ubuntu 18.10
|
||||
|
||||
@@ -1223,9 +1247,8 @@ v6.2.2
|
||||
v6.2.1
|
||||
======
|
||||
|
||||
- Fix recent versions of Tesseract (after 4.0.0-beta1) not being
|
||||
detected as supporting the ``sandwich`` renderer
|
||||
(`#271 <https://github.com/ppjbarlow83/OCRmyPDF/issues/271>`__).
|
||||
- Fixed recent versions of Tesseract (after 4.0.0-beta1) not being
|
||||
detected as supporting the ``sandwich`` renderer (:issue:`271`).
|
||||
|
||||
v6.2.0
|
||||
======
|
||||
@@ -1238,21 +1261,19 @@ v6.2.0
|
||||
- Creation of PDF/A-3 is now supported. However, there is no ability to
|
||||
attach files to PDF/A-3.
|
||||
- Lists more reasons why the file size might grow.
|
||||
- Fix issue
|
||||
`#262 <https://github.com/ppjbarlow83/OCRmyPDF/issues/262>`__,
|
||||
- Fixed :issue:`262`,
|
||||
``--remove-background`` error on PDFs contained colormapped
|
||||
(paletted) images.
|
||||
- Fix another XMP metadata validation issue, in cases where the input
|
||||
- Fixed another XMP metadata validation issue, in cases where the input
|
||||
file's creation date has no timezone and the creation date is not
|
||||
overridden.
|
||||
|
||||
v6.1.5
|
||||
======
|
||||
|
||||
- Fix issue
|
||||
`#253 <https://github.com/jbarlow83/OCRmyPDF/issues/253>`__, a
|
||||
- Fixed :issue:`253`, a
|
||||
possible division by zero when using the ``hocr`` renderer.
|
||||
- Fix incorrectly formatted ``<xmp:ModifyDate>`` field inside XMP
|
||||
- Fixed incorrectly formatted ``<xmp:ModifyDate>`` field inside XMP
|
||||
metadata for PDF/As. veraPDF flags this as a PDF/A validation
|
||||
failure. The error is caused the timezone and final digit of the
|
||||
seconds of modified time to be omitted, so at worst the modification
|
||||
@@ -1261,7 +1282,7 @@ v6.1.5
|
||||
v6.1.4
|
||||
======
|
||||
|
||||
- Fix issue `#248 <https://github.com/jbarlow83/OCRmyPDF/issues/248>`__
|
||||
- Fixed :issue:`248`
|
||||
``--clean`` argument may remove OCR from left column of text on
|
||||
certain documents. We now set ``--layout none`` to suppress this.
|
||||
- The test cache was updated to reflect the change above.
|
||||
@@ -1286,8 +1307,7 @@ Notes
|
||||
v6.1.3
|
||||
======
|
||||
|
||||
- Fix issue
|
||||
`#247 <https://github.com/jbarlow83/OCRmyPDF/issues/247>`__,
|
||||
- Fixed :issue:`247`,
|
||||
``/CreationDate`` metadata not copied from input to output.
|
||||
- A warning is now issued when Python 3.5 is used on files with a large
|
||||
page count, as this case is known to regress to single core
|
||||
@@ -1297,13 +1317,13 @@ v6.1.2
|
||||
======
|
||||
|
||||
- Upgrade to PyMuPDF v1.12.5 which includes a more complete fix to
|
||||
`#239 <https://github.com/jbarlow83/OCRmyPDF/issues/239>`__.
|
||||
:issue:`239`.
|
||||
- Add ``defusedxml`` dependency.
|
||||
|
||||
v6.1.1
|
||||
======
|
||||
|
||||
- Fix text being reported as found on all pages if PyMuPDF is not
|
||||
- Fixed text being reported as found on all pages if PyMuPDF is not
|
||||
installed.
|
||||
|
||||
v6.1.0
|
||||
@@ -1314,15 +1334,15 @@ v6.1.0
|
||||
PyMuPDF than the author anticipated. (For version 6.x only) install
|
||||
OCRmyPDF with ``pip install ocrmypdf[fitz]`` to use it to its full
|
||||
potential.
|
||||
- Fix ``FileExistsError`` that could occur if OCR timed out while it
|
||||
- Fixed ``FileExistsError`` that could occur if OCR timed out while it
|
||||
was generating the output file.
|
||||
(`#218 <https://github.com/jbarlow83/OCRmyPDF/issues/218>`__)
|
||||
- Fix table of contents/bookmarks all being redirected to page 1 when
|
||||
(:issue:`218`)
|
||||
- Fixed table of contents/bookmarks all being redirected to page 1 when
|
||||
generating a PDF/A (with PyMuPDF). (Without PyMuPDF the table of
|
||||
contents is removed in PDF/A mode.)
|
||||
- Fix "RuntimeError: invalid key in dict" when table of
|
||||
- Fixed "RuntimeError: invalid key in dict" when table of
|
||||
contents/bookmarks titles contained the character ``)``.
|
||||
(`#239 <https://github.com/jbarlow83/OCRmyPDF/issues/239>`__)
|
||||
(:issue:`239`)
|
||||
- Added a new argument ``--skip-repair`` to skip the initial PDF repair
|
||||
step if the PDF is already well-formed (because another program
|
||||
repaired it).
|
||||
@@ -1349,35 +1369,29 @@ v6.0.0
|
||||
|
||||
- Fixed an issue where OCRmyPDF failed to detect existing text on
|
||||
pages, depending on how the text and fonts were encoded within the
|
||||
PDF. (`#233 <https://github.com/jbarlow83/OCRmyPDF/issues/233>`__,
|
||||
`#232 <https://github.com/jbarlow83/OCRmyPDF/issues/232>`__)
|
||||
PDF. (:issue:`233,232`)
|
||||
- Fixed an issue that caused dramatic inflation of file sizes when
|
||||
``--skip-text --output-type pdf`` was used. OCRmyPDF now removes
|
||||
duplicate resources such as fonts, images and other objects that it
|
||||
generates.
|
||||
(`#237 <https://github.com/jbarlow83/OCRmyPDF/issues/237>`__)
|
||||
generates. (:issue:`237`)
|
||||
- Improved performance of the initial page splitting step. Originally
|
||||
this step was not believed to be expensive and ran in a process.
|
||||
Large file testing revealed it to be a bottleneck, so it is now
|
||||
parallelized. On a 700 page file with quad core machine, this change
|
||||
saves about 2 minutes.
|
||||
(`#234 <https://github.com/jbarlow83/OCRmyPDF/issues/234>`__)
|
||||
saves about 2 minutes. (:issue:`234`)
|
||||
- The test suite now includes a cache that can be used to speed up test
|
||||
runs across platforms. This also does not require computing
|
||||
checksums, so it's faster.
|
||||
(`#217 <https://github.com/jbarlow83/OCRmyPDF/issues/217>`__)
|
||||
checksums, so it's faster. (:issue:`217`)
|
||||
|
||||
v5.7.0
|
||||
======
|
||||
|
||||
- Fixed an issue that caused poor CPU utilization on machines with more
|
||||
than 4 cores when running Tesseract 4. (Related to issue
|
||||
`#217 <https://github.com/jbarlow83/OCRmyPDF/issues/217>`__.)
|
||||
than 4 cores when running Tesseract 4. (Related to :issue:`217`.)
|
||||
- The 'hocr' renderer has been improved. The 'sandwich' and 'tesseract'
|
||||
renderers are still better for most use cases, but 'hocr' may be
|
||||
useful for people who work with the PDF.js renderer in English/ASCII
|
||||
languages.
|
||||
(`#225 <https://github.com/jbarlow83/OCRmyPDF/issues/225>`__)
|
||||
languages. (:issue:`225`)
|
||||
|
||||
- It now formats text in a matter that is easier for certain PDF
|
||||
viewers to select and extract copy and paste text. This should
|
||||
@@ -1405,11 +1419,10 @@ v5.6.2
|
||||
v5.6.1
|
||||
======
|
||||
|
||||
- Fix issue
|
||||
`#219 <https://github.com/jbarlow83/OCRmyPDF/issues/219>`__: change
|
||||
- Fixed :issue:`219`: change
|
||||
how the final output file is created to avoid triggering permission
|
||||
errors when the output is a special file such as ``/dev/null``
|
||||
- Fix test suite failures due to a qpdf 8.0.0 regression and Python
|
||||
- Fixed test suite failures due to a qpdf 8.0.0 regression and Python
|
||||
3.5's handling of symlink
|
||||
- The "encrypted PDF" error message was different depending on the type
|
||||
of PDF encryption. Now a single clear message appears for all types
|
||||
@@ -1422,8 +1435,7 @@ v5.6.1
|
||||
v5.6.0
|
||||
======
|
||||
|
||||
- Fix issue
|
||||
`#216 <https://github.com/jbarlow83/OCRmyPDF/issues/216>`__: preserve
|
||||
- Fixed :issue:`216`: preserve
|
||||
"text as curves" PDFs without rasterizing file
|
||||
- Related to the above, messages about rasterizing are more consistent
|
||||
- For consistency versions minor releases will now get the trailing .0
|
||||
@@ -1435,34 +1447,32 @@ v5.5
|
||||
- Add new argument ``--max-image-mpixels``. Pillow 5.0 now raises an
|
||||
exception when images may be decompression bombs. This argument can
|
||||
be used to override the limit Pillow sets.
|
||||
- Fix output page cropped when using the sandwich renderer and OCR is
|
||||
- Fixed output page cropped when using the sandwich renderer and OCR is
|
||||
skipped on a rotated and image-processed page
|
||||
- A warning is now issued when old versions of Ghostscript are used in
|
||||
cases known to cause issues with non-Latin characters
|
||||
- Fix a few parameter validation checks for ``-output-type pdfa-1`` and
|
||||
- Fixed a few parameter validation checks for ``-output-type pdfa-1`` and
|
||||
``pdfa-2``
|
||||
|
||||
v5.4.4
|
||||
======
|
||||
|
||||
- Fix issue
|
||||
`#181 <https://github.com/jbarlow83/OCRmyPDF/issues/181>`__: fix
|
||||
- Fixed :issue:`181`: fix
|
||||
final merge failure for PDFs with more pages than the system file
|
||||
handle limit (``ulimit -n``)
|
||||
- Fix issue
|
||||
`#200 <https://github.com/jbarlow83/OCRmyPDF/issues/200>`__: an
|
||||
- Fixed :issue:`200`: an
|
||||
uncommon syntax for formatting decimal numbers in a PDF would cause
|
||||
qpdf to issue a warning, which ocrmypdf treated as an error. Now this
|
||||
the warning is relayed.
|
||||
- Fix an issue where intermediate PDFs would be created at version 1.3
|
||||
- Fixed an issue where intermediate PDFs would be created at version 1.3
|
||||
instead of the version of the original file. It's possible but
|
||||
unlikely this had side effects.
|
||||
- A warning is now issued when older versions of qpdf are used since
|
||||
issues like
|
||||
`#200 <https://github.com/jbarlow83/OCRmyPDF/issues/200>`__ cause
|
||||
:issue:`200` cause
|
||||
qpdf to infinite-loop
|
||||
- Address issue
|
||||
`#140 <https://github.com/jbarlow83/OCRmyPDF/issues/140>`__: if
|
||||
:issue:`140`: if
|
||||
Tesseract outputs invalid UTF-8, escape it and print its message
|
||||
instead of aborting with a Unicode error
|
||||
- Adding previously unlisted setup requirement, pytest-runner
|
||||
@@ -1528,13 +1538,13 @@ v5.3
|
||||
forwarded to Tesseract OCR as words and regular expressions
|
||||
respective to use to guide OCR. Supplying a list of subject-domain
|
||||
words should assist Tesseract with resolving words.
|
||||
(`#165 <https://github.com/jbarlow83/OCRmyPDF/issues/165>`__)
|
||||
(:issue:`165`)
|
||||
- Using a non Latin-1 language with the "hocr" renderer now warns about
|
||||
possible OCR quality and recommends workarounds
|
||||
(`#176 <https://github.com/jbarlow83/OCRmyPDF/issues/176>`__)
|
||||
(:issue:`176`)
|
||||
- Output file path added to error message when that location is not
|
||||
writable
|
||||
(`#175 <https://github.com/jbarlow83/OCRmyPDF/issues/175>`__)
|
||||
(:issue:`175`)
|
||||
- Otherwise valid PDFs with leading whitespace at the beginning of the
|
||||
file are now accepted
|
||||
|
||||
@@ -1562,8 +1572,7 @@ v5.1
|
||||
v5.0.1
|
||||
======
|
||||
|
||||
- Fixed issue
|
||||
`#169 <https://github.com/jbarlow83/OCRmyPDF/issues/169>`__,
|
||||
- Fixed :issue:`169`,
|
||||
exception due to failure to create sidecar text files on some
|
||||
versions of Tesseract 3.04, including the jbarlow83/ocrmypdf Docker
|
||||
image
|
||||
@@ -1581,19 +1590,17 @@ v5.0
|
||||
- Add a new feature, ``--sidecar``, which allows creating "sidecar"
|
||||
text files which contain the OCR results in plain text. These OCR
|
||||
text is more reliable than extracting text from PDFs. Closes
|
||||
`#126 <https://github.com/jbarlow83/OCRmyPDF/issues/126>`__.
|
||||
:issue:`126`.
|
||||
|
||||
- New feature: ``--pdfa-image-compression``, which allows overriding
|
||||
Ghostscript's lossy-or-lossless image encoding heuristic and making
|
||||
all images JPEG encoded or lossless encoded as desired. Fixes
|
||||
`#163 <https://github.com/jbarlow83/OCRmyPDF/issues/163>`__.
|
||||
:issue:`163`.
|
||||
|
||||
- Fixed issue
|
||||
`#143 <https://github.com/jbarlow83/OCRmyPDF/issues/143>`__, added
|
||||
- Fixed :issue:`143`, added
|
||||
``--quiet`` to suppress "INFO" messages
|
||||
|
||||
- Fixed issue
|
||||
`#164 <https://github.com/jbarlow83/OCRmyPDF/issues/164>`__, a typo
|
||||
- Fixed :issue:`164`, a typo
|
||||
|
||||
- Removed the command line parameters ``-n`` and ``--just-print`` since
|
||||
they have not worked for some time (reported as Ubuntu bug
|
||||
@@ -1602,17 +1609,14 @@ v5.0
|
||||
v4.5.6
|
||||
======
|
||||
|
||||
- Fixed issue
|
||||
`#156 <https://github.com/jbarlow83/OCRmyPDF/issues/156>`__,
|
||||
- Fixed :issue:`156`,
|
||||
'NoneType' object has no attribute 'getObject' on pages with no
|
||||
optional /Contents record. This should resolve all issues related to
|
||||
pages with no /Contents record.
|
||||
- Fixed issue
|
||||
`#158 <https://github.com/jbarlow83/OCRmyPDF/issues/158>`__, ocrmypdf
|
||||
- Fixed :issue:`158`, ocrmypdf
|
||||
now stops and terminates if Ghostscript fails on an intermediate
|
||||
step, as it is not possible to proceed.
|
||||
- Fixed issue
|
||||
`#160 <https://github.com/jbarlow83/OCRmyPDF/issues/160>`__,
|
||||
- Fixed :issue:`160`,
|
||||
exception thrown on certain invalid arguments instead of error
|
||||
message
|
||||
|
||||
@@ -1620,20 +1624,19 @@ v4.5.5
|
||||
======
|
||||
|
||||
- Automated update of macOS homebrew tap
|
||||
- Fixed issue
|
||||
`#154 <https://github.com/jbarlow83/OCRmyPDF/issues/154>`__, KeyError
|
||||
- Fixed :issue:`154`, KeyError
|
||||
'/Contents' when searching for text on blank pages that have no
|
||||
/Contents record. Note: incomplete fix for this issue.
|
||||
|
||||
v4.5.4
|
||||
======
|
||||
|
||||
- Fix ``--skip-big`` raising an exception if a page contains no images
|
||||
(`#152 <https://github.com/jbarlow83/OCRmyPDF/issues/152>`__) (thanks
|
||||
- Fixed ``--skip-big`` raising an exception if a page contains no images
|
||||
(:issue:`152`) (thanks
|
||||
to @TomRaz)
|
||||
- Fix an issue where pages with no images might trigger "cannot write
|
||||
- Fixed an issue where pages with no images might trigger "cannot write
|
||||
mode P as JPEG"
|
||||
(`#151 <https://github.com/jbarlow83/OCRmyPDF/issues/151>`__)
|
||||
(:issue:`151`)
|
||||
|
||||
v4.5.3
|
||||
======
|
||||
@@ -1652,8 +1655,7 @@ v4.5.3
|
||||
v4.5.2
|
||||
======
|
||||
|
||||
- Fix issue
|
||||
`#147 <https://github.com/jbarlow83/OCRmyPDF/issues/147>`__.
|
||||
- Fixed :issue:`147`,
|
||||
``--pdf-renderer tess4 --clean`` will produce an oversized page
|
||||
containing the original image in the bottom left corner, due to loss
|
||||
DPI information.
|
||||
@@ -1663,8 +1665,7 @@ v4.5.2
|
||||
v4.5.1
|
||||
======
|
||||
|
||||
- Fix issue
|
||||
`#137 <https://github.com/jbarlow83/OCRmyPDF/issues/137>`__,
|
||||
- Fixed :issue:`137`,
|
||||
proportions of images with a non-square pixel aspect ratio would be
|
||||
distorted in output for ``--force-ocr`` and some other combinations
|
||||
of flags
|
||||
@@ -1673,7 +1674,7 @@ v4.5
|
||||
====
|
||||
|
||||
- PDFs containing "Form XObjects" are now supported (issue
|
||||
`#134 <https://github.com/jbarlow83/OCRmyPDF/issues/134>`__; PDF
|
||||
:issue:`134`; PDF
|
||||
reference manual 8.10), and images they contain are taken into
|
||||
account when determining the resolution for rasterizing
|
||||
- The Tesseract 4 Docker image no longer includes all languages,
|
||||
@@ -1802,7 +1803,7 @@ v4.2.5
|
||||
======
|
||||
|
||||
- Fixed an issue
|
||||
(`#100 <https://github.com/jbarlow83/OCRmyPDF/issues/100>`__) with
|
||||
(:issue:`100`) with
|
||||
PDFs that omit the optional /BitsPerComponent parameter on images
|
||||
- Removed non-free file milk.pdf
|
||||
|
||||
@@ -1810,7 +1811,7 @@ v4.2.4
|
||||
======
|
||||
|
||||
- Fixed an error
|
||||
(`#90 <https://github.com/jbarlow83/OCRmyPDF/issues/90>`__) caused by
|
||||
(:issue:`90`) caused by
|
||||
PDFs that use stencil masks properly
|
||||
- Fixed handling of PDFs that try to draw images or stencil masks
|
||||
without properly setting up the graphics state (such images are now
|
||||
@@ -1848,7 +1849,7 @@ v4.2
|
||||
|
||||
- ocrmypdf will now try to convert single image files to PDFs if they
|
||||
are provided as input
|
||||
(`#15 <https://github.com/jbarlow83/OCRmyPDF/issues/15>`__)
|
||||
(:issue:`15`)
|
||||
|
||||
- This is a basic convenience feature. It only supports a single
|
||||
image and always makes the image fill the whole page.
|
||||
@@ -1876,11 +1877,11 @@ v4.2
|
||||
- supports reinterpreting PDFs where text was rendered as curves for
|
||||
printing, and text needs to be recovered
|
||||
- fixes issue
|
||||
`#82 <https://github.com/jbarlow83/OCRmyPDF/issues/82>`__
|
||||
:issue:`82`
|
||||
|
||||
- Fixes an issue where, with certain settings, monochrome images in
|
||||
PDFs would be converted to 8-bit grayscale, increasing file size
|
||||
(`#79 <https://github.com/jbarlow83/OCRmyPDF/issues/79>`__)
|
||||
(:issue:`79`)
|
||||
- Support for Ubuntu 12.04 LTS "precise" has been dropped in favor of
|
||||
(roughly) Ubuntu 14.04 LTS "trusty"
|
||||
|
||||
@@ -1908,7 +1909,7 @@ v4.1.3
|
||||
|
||||
- More helpful error message for PDFs with version 4 security handler
|
||||
- Update usage instructions for Windows/Docker users
|
||||
- Fix order of operations for matrix multiplication (no effect on most
|
||||
- Fixed order of operations for matrix multiplication (no effect on most
|
||||
users)
|
||||
- Add a few leptonica wrapper functions (no effect on most users)
|
||||
|
||||
@@ -2001,7 +2002,7 @@ New features
|
||||
dominant orientation of detectable text. This feature is fairly
|
||||
reliable but some false positives occur especially if there is not
|
||||
much text to work with.
|
||||
(`#4 <https://github.com/jbarlow83/OCRmyPDF/issues/4>`__)
|
||||
(:issue:`4`)
|
||||
- Deskewing is now performed using Leptonica instead of unpaper.
|
||||
Leptonica is faster and more reliable at image deskewing than
|
||||
unpaper.
|
||||
@@ -2014,13 +2015,13 @@ Fixes
|
||||
- Fixed an issue where lossless reconstruction could misalign the
|
||||
graphics layer with respect to text layer if the page had been
|
||||
cropped such that its origin is not (0, 0)
|
||||
(`#49 <https://github.com/jbarlow83/OCRmyPDF/issues/49>`__)
|
||||
(:issue:`49`)
|
||||
|
||||
Changes
|
||||
|
||||
- Logging output is now much easier to read
|
||||
- ``--deskew`` is now performed by Leptonica instead of unpaper
|
||||
(`#25 <https://github.com/jbarlow83/OCRmyPDF/issues/25>`__)
|
||||
(:issue:`25`)
|
||||
- libffi is now required
|
||||
- Some changes were made to the Docker and Travis build environments to
|
||||
support libffi
|
||||
@@ -2035,7 +2036,7 @@ v3.2.1
|
||||
|
||||
Changes
|
||||
|
||||
- Fixed issue `#47 <https://github.com/jbarlow83/OCRmyPDF/issues/47>`__
|
||||
- Fixed :issue:`47`
|
||||
"convert() got and unexpected keyword argument 'dpi'" by upgrading to
|
||||
img2pdf 0.2
|
||||
- Tweaked the Dockerfiles
|
||||
@@ -2080,8 +2081,7 @@ Changes
|
||||
- Python 3.5 and macOS El Capitan are now supported platforms - no
|
||||
changes were needed to implement support
|
||||
- Improved some error messages related to missing input files
|
||||
- Fixed issue `#20 <https://github.com/jbarlow83/OCRmyPDF/issues/20>`__
|
||||
- uppercase .PDF extension not accepted
|
||||
- Fixed :issue:`20`: uppercase .PDF extension not accepted
|
||||
- Fixed an issue where OCRmyPDF failed to text that certain pages
|
||||
contained previously OCR'ed text, such as OCR text produced by
|
||||
Tesseract 3.04
|
||||
@@ -2158,19 +2158,19 @@ Release candidates^
|
||||
|
||||
- rc9:
|
||||
|
||||
- fix issue
|
||||
`#118 <https://github.com/jbarlow83/OCRmyPDF/issues/118>`__:
|
||||
- Fix
|
||||
:issue:`118`:
|
||||
report error if ghostscript iccprofiles are missing
|
||||
- fixed another issue related to
|
||||
`#111 <https://github.com/jbarlow83/OCRmyPDF/issues/111>`__: PDF
|
||||
:issue:`111`: PDF
|
||||
rasterized to palette file
|
||||
- add support image files with a palette
|
||||
- don't try to validate PDF file after an exception occurs
|
||||
|
||||
- rc8:
|
||||
|
||||
- fix issue
|
||||
`#111 <https://github.com/jbarlow83/OCRmyPDF/issues/111>`__:
|
||||
- Fix
|
||||
:issue:`111`:
|
||||
exception thrown if PDF is missing DocumentInfo dictionary
|
||||
|
||||
- rc7:
|
||||
|
||||
+4
-1
@@ -3,11 +3,14 @@ requires = [
|
||||
"setuptools >= 30.3.0",
|
||||
"wheel",
|
||||
"cffi",
|
||||
"setuptools_scm",
|
||||
"setuptools_scm[toml] >= 3.4",
|
||||
"setuptools_scm_git_archive"
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.setuptools_scm]
|
||||
version_scheme = "post-release"
|
||||
|
||||
[tool.black]
|
||||
line-length = 88
|
||||
target-version = ["py36", "py37", "py38"]
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
# requirements.txt can be used to replicate the developer's build environment
|
||||
# setup.py lists a separate set of requirements that are looser to simplify
|
||||
# installation
|
||||
# Deprecated and not maintained; use "pip install ocrmypdf" instead
|
||||
cffi == 1.14.5
|
||||
coloredlogs == 15.0 # technically optional
|
||||
img2pdf == 0.4.0
|
||||
pdfminer.six == 20201018
|
||||
pikepdf == 2.10.0
|
||||
pluggy == 0.13.1
|
||||
Pillow == 8.1.2
|
||||
Pillow == 8.2.0
|
||||
reportlab == 3.5.66
|
||||
tqdm == 4.59.0
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# Deprecated and not maintained; use "pip install ocrmypdf[test]" instead
|
||||
pytest >= 6.0.0
|
||||
pytest-xdist >= 2.2.0
|
||||
pytest-cov >= 2.11.1
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
# Deprecated and not maintained; use "pip install ocrmypdf[watcher]" instead
|
||||
watchdog == 1.0.2
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
# Deprecated and not maintained; use "pip install ocrmypdf[webservice]" instead
|
||||
Flask >= 1, < 2
|
||||
|
||||
@@ -1,8 +1,102 @@
|
||||
[metadata]
|
||||
name = ocrmypdf
|
||||
description = OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
|
||||
long_description = file: README.md
|
||||
long_description_content_type = text/markdown; charset=UTF-8
|
||||
url = https://github.com/jbarlow83/OCRmyPDF
|
||||
author = James R. Barlow
|
||||
author_email = james@purplerock.ca
|
||||
license_files =
|
||||
LICENSE
|
||||
keywords =
|
||||
PDF
|
||||
OCR
|
||||
optical character recognition
|
||||
PDF/A
|
||||
scanning
|
||||
classifiers =
|
||||
Programming Language :: Python :: 3.6
|
||||
Programming Language :: Python :: 3.7
|
||||
Programming Language :: Python :: 3.8
|
||||
Programming Language :: Python :: 3.9
|
||||
Development Status :: 5 - Production/Stable
|
||||
Environment :: Console
|
||||
Intended Audience :: End Users/Desktop
|
||||
Intended Audience :: Science/Research
|
||||
Intended Audience :: System Administrators
|
||||
License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
|
||||
Operating System :: MacOS :: MacOS X
|
||||
Operating System :: Microsoft :: Windows :: Windows 10
|
||||
Operating System :: POSIX
|
||||
Operating System :: POSIX :: BSD
|
||||
Operating System :: POSIX :: Linux
|
||||
Topic :: Scientific/Engineering :: Image Recognition
|
||||
Topic :: Text Processing :: Indexing
|
||||
Topic :: Text Processing :: Linguistic
|
||||
project_urls =
|
||||
Documentation = https://ocrmypdf.readthedocs.io/
|
||||
Source = https://github.com/jbarlow83/ocrmypdf
|
||||
Tracker = https://github.com/jbarlow83/ocrmypdf/issues
|
||||
|
||||
[options]
|
||||
zip_safe = False
|
||||
packages = find:
|
||||
package_dir =
|
||||
=src
|
||||
platforms = any
|
||||
include_package_data=True
|
||||
install_requires =
|
||||
cffi >= 1.9.1 # must be a setup and install requirement
|
||||
coloredlogs >= 14.0 # strictly optional
|
||||
img2pdf >= 0.3.0, < 0.5 # pure Python, so track HEAD closely
|
||||
pdfminer.six >= 20191110, != 20200720, <= 20201018
|
||||
pikepdf >= 2.10.0
|
||||
Pillow >= 8.2.0
|
||||
pluggy >= 0.13.0, < 1.0
|
||||
reportlab >= 3.5.66
|
||||
setuptools
|
||||
tqdm >= 4
|
||||
python_requires = >= 3.6
|
||||
setup_requires = # can be removed whenever we can drop pip 9 support
|
||||
cffi >= 1.9.1 # to build the leptonica module
|
||||
setuptools_scm # so that version will work
|
||||
setuptools_scm_git_archive # enable version from github tarballs
|
||||
|
||||
[options.package_data]
|
||||
ocrmypdf =
|
||||
data/sRGB.icc
|
||||
py.typed
|
||||
|
||||
[options.packages.find]
|
||||
where = src
|
||||
|
||||
[options.extras_require]
|
||||
test =
|
||||
pytest >= 6.0.0
|
||||
pytest-xdist >= 2.2.0
|
||||
pytest-cov >= 2.11.1
|
||||
python-xmp-toolkit == 2.0.1 # also requires apt-get install libexempi3
|
||||
# or brew install exempi
|
||||
docs =
|
||||
sphinx
|
||||
sphinx_rtd_theme
|
||||
sphinx-issues
|
||||
extended_test =
|
||||
PyMuPDF == 1.13.4
|
||||
watcher =
|
||||
watchdog >= 1.0.2, < 2
|
||||
webservice =
|
||||
Flask >= 1, < 2
|
||||
|
||||
[options.entry_points]
|
||||
console_scripts =
|
||||
ocrmypdf = ocrmypdf.__main__:run
|
||||
|
||||
[bdist_wheel]
|
||||
python-tag = py36
|
||||
|
||||
[aliases]
|
||||
test=pytest
|
||||
test = pytest
|
||||
|
||||
[check-manifest]
|
||||
ignore =
|
||||
@@ -19,17 +113,14 @@ addopts =
|
||||
-n auto
|
||||
|
||||
[isort]
|
||||
multi_line_output=3
|
||||
include_trailing_comma=True
|
||||
force_grid_wrap=0
|
||||
use_parentheses=True
|
||||
line_length=88
|
||||
multi_line_output = 3
|
||||
include_trailing_comma = True
|
||||
force_grid_wrap = 0
|
||||
use_parentheses = True
|
||||
line_length = 88
|
||||
known_first_party = ocrmypdf
|
||||
known_third_party = PIL,_cffi_backend,cffi,flask,img2pdf,pdfminer,pikepdf,pkg_resources,pluggy,pytest,reportlab,setuptools,sphinx_rtd_theme,tqdm,watchdog,werkzeug
|
||||
|
||||
[metadata]
|
||||
license_file = LICENSE
|
||||
|
||||
[coverage:paths]
|
||||
source =
|
||||
src/ocrmypdf
|
||||
|
||||
@@ -1,62 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2015 James R. Barlow: github.com/jbarlow83
|
||||
# © 2021 James R. Barlow: github.com/jbarlow83
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import sys
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
if sys.version_info < (3, 6):
|
||||
print("Python 3.6 or newer is required", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
tests_require = open('requirements/test.txt', encoding='utf-8').read().splitlines()
|
||||
|
||||
|
||||
def readme():
|
||||
with open('README.md', encoding='utf-8') as f:
|
||||
return f.read()
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
# Minimal setup to support older setuptools/setuptools_scm
|
||||
setup(
|
||||
name='ocrmypdf',
|
||||
description='OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched',
|
||||
long_description=readme(),
|
||||
long_description_content_type='text/markdown',
|
||||
url='https://github.com/jbarlow83/OCRmyPDF',
|
||||
author='James R. Barlow',
|
||||
author_email='james@purplerock.ca',
|
||||
packages=find_packages('src', exclude=["tests", "tests.*"]),
|
||||
package_dir={'': 'src'},
|
||||
keywords=['PDF', 'OCR', 'optical character recognition', 'PDF/A', 'scanning'],
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Environment :: Console",
|
||||
"Intended Audience :: End Users/Desktop",
|
||||
"Intended Audience :: Science/Research",
|
||||
"Intended Audience :: System Administrators",
|
||||
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
|
||||
"Operating System :: MacOS :: MacOS X",
|
||||
"Operating System :: Microsoft :: Windows :: Windows 10",
|
||||
"Operating System :: POSIX",
|
||||
"Operating System :: POSIX :: BSD",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
"Topic :: Scientific/Engineering :: Image Recognition",
|
||||
"Topic :: Text Processing :: Indexing",
|
||||
"Topic :: Text Processing :: Linguistic",
|
||||
],
|
||||
python_requires=' >= 3.6',
|
||||
setup_requires=[ # can be removed whenever we can drop pip 9 support
|
||||
'cffi >= 1.9.1', # to build the leptonica module
|
||||
'setuptools_scm', # so that version will work
|
||||
@@ -64,26 +16,4 @@ setup(
|
||||
],
|
||||
use_scm_version={'version_scheme': 'post-release'},
|
||||
cffi_modules=['src/ocrmypdf/lib/compile_leptonica.py:ffibuilder'],
|
||||
install_requires=[
|
||||
'cffi >= 1.9.1', # must be a setup and install requirement
|
||||
'coloredlogs >= 14.0', # strictly optional
|
||||
'img2pdf >= 0.3.0, < 0.5', # pure Python, so track HEAD closely
|
||||
'pdfminer.six >= 20191110, != 20200720, <= 20201018',
|
||||
"pikepdf >= 2.10.0",
|
||||
'Pillow >= 8.1.2',
|
||||
'pluggy >= 0.13.0, < 1.0',
|
||||
'reportlab >= 3.5.66',
|
||||
'setuptools',
|
||||
'tqdm >= 4',
|
||||
],
|
||||
tests_require=tests_require,
|
||||
entry_points={'console_scripts': ['ocrmypdf = ocrmypdf.__main__:run']},
|
||||
package_data={'ocrmypdf': ['data/sRGB.icc', 'py.typed']},
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
project_urls={
|
||||
'Documentation': 'https://ocrmypdf.readthedocs.io/',
|
||||
'Source': 'https://github.com/jbarlow83/ocrmypdf',
|
||||
'Tracker': 'https://github.com/jbarlow83/ocrmypdf/issues',
|
||||
},
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
- Search for deprecation: search all files for deprec*, etc.
|
||||
|
||||
- Check requirements/*
|
||||
- Check requirements in setup.cfg
|
||||
|
||||
- Delete `tests/cache`, do `pytest --runslow`, and update cache.
|
||||
|
||||
|
||||
@@ -56,11 +56,12 @@ class TesseractLoggerAdapter(logging.LoggerAdapter):
|
||||
|
||||
|
||||
class TesseractVersion(StrictVersion):
|
||||
|
||||
version_re = re.compile(
|
||||
r'''
|
||||
^(\d+) \. (\d+) (\. (\d+))? # groups: 1/major, 2/minor, 3/[skip], 4/patch
|
||||
[-]? # optional hyphen separator
|
||||
(?:(alpha|beta|rc|dev)[.\-\ ]?(\d+)?)? # 5/prerelease, 6/prerelease_num
|
||||
(?:(alpha|beta|rc|dev)?[.\-\ ]?(\d+)?)? # 5/prerelease, 6/prerelease_num
|
||||
(?:-(\d+)-g[0-9a-f]+)? # untagged git version
|
||||
$
|
||||
''',
|
||||
|
||||
@@ -406,7 +406,9 @@ def run_pipeline(options, *, plugin_manager, api=False):
|
||||
log.error("KeyboardInterrupt")
|
||||
return ExitCode.ctrl_c
|
||||
except (ExitCodeException if not api else NeverRaise) as e:
|
||||
if str(e):
|
||||
if options.verbose >= 1:
|
||||
log.exception("ExitCodeException")
|
||||
elif str(e):
|
||||
log.error("%s: %s", type(e).__name__, str(e))
|
||||
else:
|
||||
log.error(type(e).__name__)
|
||||
|
||||
@@ -32,12 +32,12 @@ from ocrmypdf.helpers import (
|
||||
monotonic,
|
||||
safe_symlink,
|
||||
)
|
||||
from ocrmypdf.hocrtransform import HOCR_OK_LANGS
|
||||
from ocrmypdf.subprocess import check_external_program
|
||||
|
||||
# -------------
|
||||
# External dependencies
|
||||
|
||||
HOCR_OK_LANGS = frozenset(['eng', 'deu', 'spa', 'ita', 'por'])
|
||||
DEFAULT_LANGUAGE = 'eng' # Enforce English hegemony
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -279,7 +279,7 @@ def check_closed_streams(options): # pragma: no cover
|
||||
Attempting to a fork/exec a new Python process when any of std{in,out,err}
|
||||
are closed or not flushable for some reason may raise an exception.
|
||||
Fix this by opening devnull if the handle seems to be closed. Do this
|
||||
globally to avoid tracking places all places that fork.
|
||||
globally to avoid tracking all places that fork.
|
||||
|
||||
Seems to be specific to multiprocessing.Process not all Python process
|
||||
forkers.
|
||||
|
||||
@@ -41,6 +41,62 @@ from reportlab.lib.colors import black, cyan, magenta, red
|
||||
from reportlab.lib.units import inch
|
||||
from reportlab.pdfgen.canvas import Canvas
|
||||
|
||||
# According to Wikipedia these languages are supported in the ISO-8859-1 character
|
||||
# set, meaning reportlab can generate them and they are compatible with hocr,
|
||||
# assuming Tesseract has the necessary languages installed. Note that there may
|
||||
# not be language packs for them.
|
||||
HOCR_OK_LANGS = frozenset(
|
||||
[
|
||||
# Languages fully covered by Latin-1:
|
||||
'afr', # Afrikaans
|
||||
'alb', # Albanian
|
||||
'ast', # Leonese
|
||||
'baq', # Basque
|
||||
'bre', # Breton
|
||||
'cos', # Corsican
|
||||
'eng', # English
|
||||
'eus', # Basque
|
||||
'fao', # Faoese
|
||||
'gla', # Scottish Gaelic
|
||||
'glg', # Galician
|
||||
'glv', # Manx
|
||||
'ice', # Icelandic
|
||||
'ind', # Indonesian
|
||||
'isl', # Icelandic
|
||||
'ita', # Italian
|
||||
'ltz', # Luxembourgish
|
||||
'mal', # Malay Rumi
|
||||
'mga', # Irish
|
||||
'nor', # Norwegian
|
||||
'oci', # Occitan
|
||||
'por', # Portugeuse
|
||||
'roh', # Romansh
|
||||
'sco', # Scots
|
||||
'sma', # Sami
|
||||
'spa', # Spanish
|
||||
'sqi', # Albanian
|
||||
'swa', # Swahili
|
||||
'swe', # Swedish
|
||||
'tgl', # Tagalog
|
||||
'wln', # Walloon
|
||||
# Languages supported by Latin-1 except for a few rare characters that OCR
|
||||
# is probably not trained to recognize anyway:
|
||||
'cat', # Catalan
|
||||
'cym', # Welsh
|
||||
'dan', # Danish
|
||||
'deu', # German
|
||||
'dut', # Dutch
|
||||
'est', # Estonian
|
||||
'fin', # Finnish
|
||||
'fra', # French
|
||||
'hun', # Hungarian
|
||||
'kur', # Kurdish
|
||||
'nld', # Dutch
|
||||
'wel', # Welsh
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Element = ElementTree.Element
|
||||
|
||||
|
||||
|
||||
@@ -237,6 +237,13 @@ def test_version_comparison():
|
||||
need_version='4.0.0',
|
||||
version_parser=TesseractVersion,
|
||||
)
|
||||
vd.check_external_program(
|
||||
program="tesseract",
|
||||
package="tesseract",
|
||||
version_checker=lambda: 'v4.0.0.20181030', # Some Windows builds use this format
|
||||
need_version='4.0.0',
|
||||
version_parser=TesseractVersion,
|
||||
)
|
||||
vd.check_external_program(
|
||||
program="tesseract",
|
||||
package="tesseract",
|
||||
|
||||
Reference in New Issue
Block a user