Skip to content
Prev 45683 / 63421 Next

vignettes: problems with PDF compaction

On 4/22/2013 5:51 PM, Uwe Ligges wrote:
I meant that the code in tools::compact compares the sizes of the old
and new files and only replaces the old file if the change in size is 
"sufficient":

  if (new/old < 0.9 && new < old - 10000) {
                 file.copy(tf, p, overwrite = TRUE)
             }

At any rate, with R_GSCMD now fixed (Thx: Henrik), tools::compactPDF,
with gs_quality="ebook",
still does not reduce the size of my HE-examples.pdf file.

I tried the same on my Ubuntu system (R 2.15.2 also), and there I get

 > tools::compactPDF("HE-examples.pdf", gs_quality="ebook")
   compacted 'HE-examples.pdf' from 739Kb to 366Kb

So, I can now copy the compacted file back to my development tree
on Windows; however, as I understand things, vignettes are re-built
by R CMD build and --compact-vignettes=gs+qpdf has no effect.
So my Ubuntu-compacted file will be overwritten.

It's somewhat maddening to have to spend so much time to save ~373Kb
in order to avoid a CRAN warning.