Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b6fb62967 | ||
|
|
1db8b0b943 | ||
|
|
f38aebb3d5 | ||
|
|
7162c36d37 | ||
|
|
f4d4ea46c8 | ||
|
|
2fd1a0f178 | ||
|
|
73ed33a086 | ||
|
|
e6095a9949 | ||
|
|
16f05af401 |
@@ -1,4 +1,4 @@
|
|||||||
name: General issues
|
name: Installation, packaging, dependencies
|
||||||
description: Installation, packages, dependencies, "nothing works", test suite failures...
|
description: Installation, packages, dependencies, "nothing works", test suite failures...
|
||||||
title: "[Bug]: "
|
title: "[Bug]: "
|
||||||
labels: ["bug", "triage"]
|
labels: ["bug", "triage"]
|
||||||
@@ -9,6 +9,10 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
Thanks for taking the time to fill out this bug report!
|
Thanks for taking the time to fill out this bug report!
|
||||||
|
|
||||||
|
If your issue involves using OCRmyPDF on specific file(s) and not getting
|
||||||
|
good results, this is the *wrong* issue template. Please use the recommended
|
||||||
|
template to ensure we have enough information to help.
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: what-happened
|
id: what-happened
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -32,7 +32,20 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Files
|
label: Files
|
||||||
description: Please attach the input and output files, or any screenshots that may be helpful.
|
description: Please attach the input and output files, or any screenshots that may be helpful.
|
||||||
placeholder: Drag and drop files here
|
placeholder: |
|
||||||
|
Drag and drop files here.
|
||||||
|
|
||||||
|
If you cannot provide a test file, we probably won't be able to help with the issue.
|
||||||
|
PDF is a complex file format, and there may be technical details in the PDF that are
|
||||||
|
causing the issue. There's really no substitute for a test file.
|
||||||
|
|
||||||
|
We understand files may contain personal or sensitive information. Here are some options:
|
||||||
|
- Try reproducing the issue with a file from the test suite. (See tests/resources)
|
||||||
|
- Try to create another file in the same way as your private file.
|
||||||
|
- Encrypt the file to OCRmyPDF's private GPG key.
|
||||||
|
- Use ``qpdf --json yourfile.pdf`` to produce a JSON representation of your file that
|
||||||
|
omits personal information.
|
||||||
|
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
id: packaging-system
|
id: packaging-system
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -225,8 +225,9 @@ jobs:
|
|||||||
python -m pip install --upgrade pip wheel build
|
python -m pip install --upgrade pip wheel build
|
||||||
python -m build --sdist --wheel
|
python -m build --sdist --wheel
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
name: artifact
|
||||||
path: |
|
path: |
|
||||||
./dist/*.whl
|
./dist/*.whl
|
||||||
./dist/*.tar.gz
|
./dist/*.tar.gz
|
||||||
@@ -240,7 +241,7 @@ jobs:
|
|||||||
id-token: write # mandatory for PyPI publishing
|
id-token: write # mandatory for PyPI publishing
|
||||||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
|
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: artifact
|
name: artifact
|
||||||
path: dist
|
path: dist
|
||||||
@@ -257,7 +258,7 @@ jobs:
|
|||||||
# Required to create a release
|
# Required to create a release
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: artifact
|
name: artifact
|
||||||
path: dist
|
path: dist
|
||||||
|
|||||||
+16
-2
@@ -30,8 +30,22 @@ OCRmyPDF typically supports the three most recent Python versions.
|
|||||||
|
|
||||||
.. |OCRmyPDF PyPI| image:: https://img.shields.io/pypi/v/ocrmypdf.svg
|
.. |OCRmyPDF PyPI| image:: https://img.shields.io/pypi/v/ocrmypdf.svg
|
||||||
|
|
||||||
v16.0.0rc1
|
|
||||||
==========
|
v16.0.2
|
||||||
|
=======
|
||||||
|
|
||||||
|
- Temporarily changed PDF text renderer back to sandwich by default to address
|
||||||
|
regressions in macOS Preview.
|
||||||
|
|
||||||
|
v16.0.1
|
||||||
|
=======
|
||||||
|
|
||||||
|
- Fixed text rendering issue with new hOCR text renderer - extraneous byte order
|
||||||
|
marks.
|
||||||
|
- Tightened dependencies.
|
||||||
|
|
||||||
|
v16.0.0
|
||||||
|
=======
|
||||||
|
|
||||||
- Added OCR text renderer, combined the best ideas of Tesseract's PDF
|
- Added OCR text renderer, combined the best ideas of Tesseract's PDF
|
||||||
generator and the older hOCR transformer renderer. The result is a hopefully
|
generator and the older hOCR transformer renderer. The result is a hopefully
|
||||||
|
|||||||
+3
-3
@@ -14,11 +14,11 @@ requires-python = ">=3.10"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"Pillow>=10.0.1",
|
"Pillow>=10.0.1",
|
||||||
"deprecation>=2.1.0",
|
"deprecation>=2.1.0",
|
||||||
"img2pdf>=0.4.4",
|
"img2pdf>=0.5",
|
||||||
"packaging>=20",
|
"packaging>=20",
|
||||||
"pdfminer.six>=20220319",
|
"pdfminer.six>=20220319",
|
||||||
"pikepdf>=8.8.0",
|
"pikepdf>=8.10.1",
|
||||||
"pluggy>=0.13.0",
|
"pluggy>=1",
|
||||||
"rich>=13",
|
"rich>=13",
|
||||||
]
|
]
|
||||||
authors = [{ name = "James R. Barlow", email = "james@purplerock.ca" }]
|
authors = [{ name = "James R. Barlow", email = "james@purplerock.ca" }]
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ def check_options(options):
|
|||||||
|
|
||||||
# Decide on what renderer to use
|
# Decide on what renderer to use
|
||||||
if options.pdf_renderer == 'auto':
|
if options.pdf_renderer == 'auto':
|
||||||
options.pdf_renderer = 'hocr'
|
options.pdf_renderer = 'sandwich'
|
||||||
|
|
||||||
if not tesseract.has_thresholding() and options.tesseract_thresholding != 0:
|
if not tesseract.has_thresholding() and options.tesseract_thresholding != 0:
|
||||||
log.warning(
|
log.warning(
|
||||||
|
|||||||
@@ -106,10 +106,10 @@ class HocrTransform:
|
|||||||
self.render_options = DebugRenderOptions(
|
self.render_options = DebugRenderOptions(
|
||||||
render_baseline=debug,
|
render_baseline=debug,
|
||||||
render_triangle=debug,
|
render_triangle=debug,
|
||||||
render_line_bbox=debug,
|
render_line_bbox=False,
|
||||||
render_word_bbox=debug,
|
render_word_bbox=debug,
|
||||||
render_paragraph_bbox=debug,
|
render_paragraph_bbox=False,
|
||||||
render_space_bbox=debug,
|
render_space_bbox=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
def _get_element_text(self, element: Element):
|
def _get_element_text(self, element: Element):
|
||||||
@@ -365,7 +365,7 @@ class HocrTransform:
|
|||||||
if font_width > 0:
|
if font_width > 0:
|
||||||
text.text_transform(Matrix(1, 0, 0, 1, box.llx, 0))
|
text.text_transform(Matrix(1, 0, 0, 1, box.llx, 0))
|
||||||
text.horiz_scale(100 * box.width / font_width)
|
text.horiz_scale(100 * box.width / font_width)
|
||||||
text.show(elemtxt)
|
text.show(elemtxt.encode('utf-16be'))
|
||||||
|
|
||||||
# Get coordinates of the next word (if there is one)
|
# Get coordinates of the next word (if there is one)
|
||||||
hocr_next_box = (
|
hocr_next_box = (
|
||||||
@@ -389,7 +389,7 @@ class HocrTransform:
|
|||||||
space_width = self._font.text_width(' ', fontsize)
|
space_width = self._font.text_width(' ', fontsize)
|
||||||
if space_width > 0:
|
if space_width > 0:
|
||||||
text.horiz_scale(100 * space_box.width / space_width)
|
text.horiz_scale(100 * space_box.width / space_width)
|
||||||
text.show(' ')
|
text.show(' '.encode('utf-16be'))
|
||||||
|
|
||||||
def _debug_draw_paragraph_boxes(self, canvas: Canvas, color=CYAN):
|
def _debug_draw_paragraph_boxes(self, canvas: Canvas, color=CYAN):
|
||||||
"""Draw boxes around paragraphs in the document."""
|
"""Draw boxes around paragraphs in the document."""
|
||||||
|
|||||||
Reference in New Issue
Block a user