How to reduce the quality of pdf created using R

I create PDF reports using R (command? Pdf). The reports contain images that I created and which are quite heavy (a lot of data). The created pdf files are very heavy. Is there a way to reduce the quality of pdf when creating it?

I know that I can do this with pdftk, but I would prefer to do it at a time, since I want to minimize the number of manual operations.

+4
source share
2 answers

If your PDF has a large number of data points, sometimes raster presentation is more efficient. You lose endless zoom in vector format, but you can have a very nice view for printing or normal viewing sizes. It can also work faster.

Try creating graphics in PDF and bitmap formats and see which one is more efficient / suitable for your needs. You may be surprised that PNG makes you happier.

+3
source

There seems to be no other solution than calling pdftk:
(excerpt 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. 
+2
source

Source: https://habr.com/ru/post/1343580/


All Articles