I am trying to check a package that I have built (with vignette) using
R CMD check --as-cran [my package] in my windows command prompt. All goes well until I get the message,
WARNING 'qpdf' is needed for checks on size reduction of PDFs
I have downloaded qpdf, put the unzipped folder in my program files directory, and added the bin folder to the PATH.
Not quite sure what else I need to do? I have the feeling I have not installed qpdf correctly or I need to build this program itself? I have read through the readme files and manual for qpdf which appear to be more aimed at unix users (which I have no experience with... I am your standard/regular windows user with little to no programming experience outside of statistical languages). I have had a go at trying to build qpdf using cgywin, but ended up failing to install zlib and prec. Any tips?
preguntado el 31 de julio de 12 a las 12:07
Sys.which(Sys.getenv("R_QPDF", "qpdf")) Sys.getenv("PATH")
to establish that R is really not finding the
qpdf executable, and see where it is looking. You probably shouldn't need to rebuild everything, just figure out why R is not finding the
qpdf executable ... does running
qpdf from a terminal window work ... ? How are you starting R, and did it have a chance to get the new PATH definition (i.e. do you need to open a new terminal window, or ?? reboot ??)
The incantation above was extracted from
tools::compactPDF, from the default value of the
qpdf argument, on a Linux machine. You should check for yourself, in case (e.g.) the Windows version is looking for
qpdf.exe más bien que
There are a couple of other things to consider on a Windows machine:
If you are running the 32-bit version of R, it is important that you descargar the 32-bit version of qpdf, which is the version linked from the SourceForge homepage. If you are running a 64-bit installation of R, you will need to do a bit of digging to locate the 64-bit version of qpdf, which is buried a little more deeply (version 7.0 is listed aquí).
Once you have extracted the zipped qpdf directory to your hard disk, perhaps under
C:\Program Files\, adicional
C:\Program Files\qpdf-version_number\bin a su sistema
PATH under the environment variables, and re-launched R, Windows needs to establish that pqdf is safe to run.
C:\Program Files\qpdf-version_numer\bin y ejecutar
qpdf.exe (by double-clicking). Windows 10 throws up a security warning, as it's an unrecognized executable file. You'll need to use the más opciones link to find the button to run the program. This done, Windows will recognize the file as safe to run and allow other software, including R, to use it.
Recent developments: If you install
Rtools 3.5 qpdf is included and that warning is gone.
Rtools is a toolset for building packages on Windows and is recently reworked by Jeroen Ooms.
Más información : https://cran.r-project.org/bin/windows/Rtools/
Note that the changelog is incomplete, as Rtools 3.5 isn't frozen yet at the time of writing (2019-03-01). Even though it's not visible on the page yet,
qpdf.exe está incluido en el
bin directorio después de la instalación.
After installing the latest version of RTools, the warning still popped up. However, I noticed that the Windows "where" command gave two paths to qpdf (different versions). After removing the R_QPDF environment variable and removing the new install of qpdf from the Windows path, so that only qpdf in RTools was found, the warning disappeared.
I got the same warning on Ubuntu so here's a Ubuntu solution for completeness:
First update packages
sudo apt update
sudo apt install qpdf
Probado en Ubuntu 20.04.