Compare commits

...
5 Commits
4 changed files with 21 additions and 15 deletions
+4 -5
View File
@@ -225,8 +225,9 @@ jobs:
python -m pip install --upgrade pip wheel build
python -m build --sdist --wheel
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: artifact
path: |
./dist/*.whl
./dist/*.tar.gz
@@ -240,9 +241,8 @@ jobs:
id-token: write # mandatory for PyPI publishing
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Publish to PyPI
@@ -257,9 +257,8 @@ jobs:
# Required to create a release
contents: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Create Release
+9 -2
View File
@@ -30,8 +30,15 @@ OCRmyPDF typically supports the three most recent Python versions.
.. |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
generator and the older hOCR transformer renderer. The result is a hopefully
+3 -3
View File
@@ -14,11 +14,11 @@ requires-python = ">=3.10"
dependencies = [
"Pillow>=10.0.1",
"deprecation>=2.1.0",
"img2pdf>=0.4.4",
"img2pdf>=0.5",
"packaging>=20",
"pdfminer.six>=20220319",
"pikepdf>=8.8.0",
"pluggy>=0.13.0",
"pikepdf>=8.10.1",
"pluggy>=1",
"rich>=13",
]
authors = [{ name = "James R. Barlow", email = "james@purplerock.ca" }]
+5 -5
View File
@@ -106,10 +106,10 @@ class HocrTransform:
self.render_options = DebugRenderOptions(
render_baseline=debug,
render_triangle=debug,
render_line_bbox=debug,
render_line_bbox=False,
render_word_bbox=debug,
render_paragraph_bbox=debug,
render_space_bbox=debug,
render_paragraph_bbox=False,
render_space_bbox=False,
)
def _get_element_text(self, element: Element):
@@ -365,7 +365,7 @@ class HocrTransform:
if font_width > 0:
text.text_transform(Matrix(1, 0, 0, 1, box.llx, 0))
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)
hocr_next_box = (
@@ -389,7 +389,7 @@ class HocrTransform:
space_width = self._font.text_width(' ', fontsize)
if space_width > 0:
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):
"""Draw boxes around paragraphs in the document."""