Skip to content

[R-pkg-devel] Problem with "compacting" pdf files.

3 messages · Ivan Krylov, Rolf Turner

#
When I submitted an update of my Iso package a short time ago, it was
rejected as not passing the incoming checks automatically.  Explicitly,
I got a WARNING:
I did as instructed and ran

    tools::compactPDF("./algorithm.pdf",gs_quality="ebook")

having started R in the inst/vignettes directory, which is where the
file algorithm.pdf is to be found.

According to "ls -l" the size of algorithm.pdf was about 109 Kb. before
I ran compactPDF() and about 90 Kb. afterward.

I do not understand:

    * the reference to inst/doc (there is no such directory)
    * where the sizes 349 Kb and 99 Kb come from
    * what I have to do to get Iso to pass the required checks

The email that I received from CRAN (under the return address
ligges at statistik.tu-dortmund.de) said:
Consequently I am asking! Can anyone set me on the path to
enlightenment?  Thanks.

cheers,

Rolf Turner
#
On Sun,  1 Oct 2023 08:31:31 +0000
Rolf Turner <rolfturner at posteo.net> wrote:

            
When you run R CMD build in order to produce a new Iso-*.tar.gz, R runs
Sweave and pdflatex on vignettes/algorithm.Rnw in order to produce
inst/doc/algorithm.pdf inside the resulting tarball (but not the
original source tree on your computer).
Does it help to run R CMD build --compact-vignettes=both? This should
let R run tools::compactPDF on inst/doc/algorithm.pdf it generates
before placing it inside the package tarball.

I think that R doesn't know anything about files under inst/vignettes
in the source tree.
#
On Sun, 1 Oct 2023 15:22:34 +0300
Ivan Krylov <krylov.r00t at gmail.com> wrote:

            
Thanks Ivan.  That may well be the key.  When I unpacked the tarball
created without the --compact-vignettes=both flag, I found that
inst/doc/algorithm.pdf had size 403 Kb, whereas with that flag set
it had size 108 Kb.

I'll re-submit now and see what happens.

I *really* think that the instructions from CRAN could have been
clearer!  Without your guidance I'd have been at a total loss.

cheers,

Rolf