RockScience
RockScience

Reputation: 18580

how to reduce the quality of pdf created using R

I am creating pdf reports using R (command ?pdf). The reports contain images that I have created and that are quite heavy (lot of datapoints) The created pdfs are very heavy. Is there a way to reduce the quality of the pdf when creating it?

I know I can do it using pdftk but I'd rather do it in one go as I want to minimize the number of manual operations.

Upvotes: 4

Views: 1394

Answers (2)

John
John

Reputation: 23758

If your PDF has a large number of data points sometimes a raster presentation is more efficient. You lose the infinite zoom of a vector format but can have a very nice representation for print or normal viewing sizes. It may also render faster.

Try generating your graphic in PDF and raster formats and see which is more efficient / suits your needs. You might be surprised that a PNG makes you happier.

Upvotes: 3

RockScience
RockScience

Reputation: 18580

It seems that there is no other solution than calling pdftk:
(extract from ?pdf)

pdf writes uncompressed PDF. It is primarily intended for producing 
PDF graphics for inclusion in other documents, and PDF-includers such 
as pdftex are usually able to handle compression: there are a large 
number of PDF compression utilities such as pdftk. 

Upvotes: 2

Related Questions