Skip to content
Prev 9665 / 12125 Next

[R-pkg-devel] Problem persists, was Re: Problem compressing vignettes for CRAN

On Sun, 8 Oct 2023 16:47:41 +0100
Michael Dewey <lists at dewey.myzen.co.uk> wrote:

            
While running R, does Sys.which('qpdf') return the path to qpdf.exe?
Does Sys.getenv('PATH') match your expectations?
Well, R tries to resolve the path to qpdf.exe using Sys.which(), so it
must work if it's on the %PATH%, but if all else fails, setting this
environment variable should help.
It always depends on how the final command line is built by a
particular function, but it should work by taking plain file paths
without any escaping and quotation. The directory separators shouldn't
matter either.

(tools::compactPDF uses system2(), so it quotes the path to the
executable by itself.)
It must be the full path to the executable, including the final
qpdf.exe.
tools::compactPDF() expects gswin64c.exe or gswin32c.exe on the PATH.
If it's not there, R_GSCMD must be set to the full path to the
executable. Judging by the NOTE you've received, it's Ghostscript that
performed most of the compaction in your case.