Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4d4ea46c8 | ||
|
|
2fd1a0f178 | ||
|
|
73ed33a086 | ||
|
|
e6095a9949 | ||
|
|
16f05af401 |
@@ -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,9 +241,8 @@ 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
|
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
@@ -257,9 +257,8 @@ 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
|
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
|
|||||||
@@ -30,8 +30,15 @@ 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.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" }]
|
||||||
|
|||||||
@@ -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