File: 0005-Use-pdftotext-not-gs-to-work-around-broken-gs.patch

package info (click to toggle)
plastex 3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,132 kB
  • sloc: python: 23,341; xml: 18,076; javascript: 7,755; ansic: 46; makefile: 40; sh: 26
file content (27 lines) | stat: -rw-r--r-- 1,053 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Stuart Prescott <stuart@debian.org>
Date: Mon, 11 Nov 2024 17:14:38 +1100
Subject: Use pdftotext not gs to work around broken gs

Bug-Debian: https://bugs.debian.org/1082694
Forwarded: no

Version 10.04.0~dfsg-1 of gs ships a broken txtwrite device that gets the
contents of PDFs wrong. pdftotext works, so switch to that instead, given
it's already installed anyway.
---
 unittests/helpers/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unittests/helpers/utils.py b/unittests/helpers/utils.py
index e37ddd8..ad29b07 100644
--- a/unittests/helpers/utils.py
+++ b/unittests/helpers/utils.py
@@ -72,7 +72,7 @@ def compare_output(tex: str):
                     return plastex_out.strip() == ""
 
                 out = subprocess.run(
-                        ["gs", "-q", "-sDEVICE=txtwrite", "-o", "%stdout%", "test.pdf"],
+                        ["pdftotext", "test.pdf", "-"],
                         check=True,
                         stdout=subprocess.PIPE,
                         stdin=subprocess.DEVNULL,