Skip to content

Commit

Permalink
Fix Ghostscript installation instructions and add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarlow83 committed Nov 29, 2023
1 parent 9898904 commit c90d5cd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,17 @@ package manager:

* ``winget install -e --id Python.Python.3.11``
* ``winget install -e --id UB-Mannheim.TesseractOCR``
* ``winget install -e --id ArtifexSoftware.GhostScript``

You will need to install Ghostscript manually, `since it does not support automated
installs anymore <https://artifex.com/news/ghostscript-10.01.0-disabling-silent-install-option>`_.

* `Ghostscript download page <https://ghostscript.com/releases/gsdnld.html>`_.`

(Or alternately, using the `Chocolatey <https://chocolatey.org/>`_ package manager, install
the following when running in an Administrator command prompt):

* ``choco install python3``
* ``choco install --pre tesseract``
* ``choco install ghostscript``
* ``choco install pngquant`` (optional)

Either set of commands will install the required software. At the mmoment there is no
Expand Down
6 changes: 6 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ tagged yet.

.. |OCRmyPDF PyPI| image:: https://img.shields.io/pypi/v/ocrmypdf.svg

v15.4.4
=======

- Fixed documentation for installing Ghostscript on Windows. :issue:`1198`
- Added warning message about security issue in older versions of Ghostscript.

v15.4.3
=======

Expand Down
13 changes: 11 additions & 2 deletions src/ocrmypdf/builtin_plugins/ghostscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import logging

from packaging.version import Version

from ocrmypdf import hookimpl
from ocrmypdf._exec import ghostscript
from ocrmypdf.exceptions import MissingDependencyError
Expand Down Expand Up @@ -58,8 +60,15 @@ def check_options(options):
if gs_version in BLACKLISTED_GS_VERSIONS:
raise MissingDependencyError(
f"Ghostscript {gs_version} contains serious regressions and is not "
"supported. Please upgrade to a newer version, or downgrade to the "
"previous version."
"supported. Please upgrade to a newer version."
)
if gs_version < Version('10.02.0'):
log.warning(
f"The installed version of Ghostscript {gs_version}, contains a remote "
"code execution security vulnerability. Please upgrade to a newer "
"version. For details see CVE-2023-43115. The issue is not known to "
"affect OCRmyPDF or processing PDFs with Ghostscript, but upgrading "
"Ghostscript is recommended."
)

if options.output_type == 'pdfa':
Expand Down

0 comments on commit c90d5cd

Please sign in to comment.