FS#64134 - [ghostscript] incorrect bbox is produced in pdfcrop

Attached to Project: Arch Linux
Opened by Karl Yngve Lervåg (lervag) - Tuesday, 15 October 2019, 13:54 GMT
Last edited by Andreas Radke (AndyRTR) - Tuesday, 15 October 2019, 16:23 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: `pdfcrop` from `texlive-core` relies on `ghostscript` to find a bounding box for cropping PDFs. However, in a recent version of `ghostscript` there is some bug that prevents it from reporting the correct bounding box.

The bug was raised [on Debian as well](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927429), where it is now resolved as fixed. I was wondering if it could be that a patch was not yet applied for the Arch package.

Version 9.26-2 is the most recent version where everything works for me.
Version 9.27-1 is the first version that does not work.
Version 9.27-2 is the current version; the bug is still present.

To reproduce the issue:

1. Create following `tex` file:

```
\documentclass[8pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{helvet}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{parskip}
\usepackage{siunitx}
\usepackage[paperwidth=3.9in]{geometry}
\usepackage{tikz}
\pagestyle{empty}

\renewcommand{\familydefault}{\sfdefault}

\sisetup{per-mode=symbol}
\sisetup{range-phrase=--}
\sisetup{range-units=single}

\newcommand*{\dif}{\text{d}}
\newcommand*{\dt}[1]{\ensuremath{\frac{\partial #1}{\partial t}}}
\newcommand*{\odt}[1]{\ensuremath{\frac{\dif #1}{\dif t}}}
\newcommand*{\od}[2]{\ensuremath{\frac{\dif #1}{\dif #2}}}
\newcommand*{\pd}[2]{\ensuremath{\frac{\partial #1}{\partial{#2}}}}
\newcommand*{\vct}[1]{\ensuremath{\boldsymbol{#1}}}
\newcommand*{\bigo}[1]{\ensuremath{\mathcal{O}\left(#1\right)}}
\renewcommand{\div}{\boldsymbol\nabla\cdot}
\newcommand{\grad}{\boldsymbol\nabla}
\newcommand{\lapl}{\boldsymbol\Delta}
\newcommand{\curl}{\boldsymbol\Delta\times}

\begin{document}
\begin{displaymath} 10 \log_{10}\left(\frac{P}{P_0}\right) \end{displaymath}
\end{document}
```

2. Compile with `latexmk -pdf test.tex`.

3. Try `pdfcrop --verbose test.pdf cropped.pdf`. The cropped PDF is correct for version 9.26, but faulty from version 9.27.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Tuesday, 15 October 2019, 16:23 GMT
Reason for closing:  Upstream
Comment by Andreas Radke (AndyRTR) - Tuesday, 15 October 2019, 16:21 GMT
This upstream fix has been pushed to git only a few days after last 9.27 release.
Upstream is now already in late RC stage (9.28rc4). Feel free to apply this single commit to a custom local build on your own until the new release hits our repos:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=06c920713e11

Loading...