I created a plot using pgfplots. The plot is embedded in a document. The total size of the document is about 26 MB, while the plot is 12.5 MB.
The plot contains a lot of data which makes the pdf file quiet large, 12.4 MB in fact (Note: this is also caused due to the fact that I use the spy library of tikz). This causes the pdf reader become a bit slow when you look at the pag which includes the figure. The biggest problem I have is when I want to print the .pdf when using Adobe Acrobat. When I try to print it using Envince no problems occur. Because the document is most likely to be published I want to fix this, since (unfortunately) a lot of people use Adobe Acrobat.
Now I am wondering what the best approach would be for reducing the file size
- I can choose to remove data from the plot
- I can choose to convert the pdf to an image format, like .jpg or .png
- Try to reduce the .pdf file size, http://www.wikihow.com/Reduce-PDF-File-Size, which I tried
- …?
Now I am wondering what the best approach would be.
Option 1 is not really possible since I want to keep the data, most of the plots are on top of each other and due to the fact that each plot has a certain opacity level you see the concentration where they bundle.
Option 2 is possible however than I loose the vector format. Zooming in in a pdf viewer would become pixely. The document which includes the figure is very likely to be published so I am not sure if I want this.
Option 3 I tried this but it only reduces the filesize with a few MB's, from 12.5 MB to 9 MB, so not that much.
For people that are interested the pdf file of the figure: https://dl.dropboxusercontent.com/u/20782274/pato_scenario_1_dataloss06_output.pdf
Best Answer
Procedure for printing export of single image PDFs:
convert/export it to svg
inkscape -l reduce_temp.svg pato_scenario_1_dataloss06_output.pdf
generate HiDPI images: 1200dpi - common home printer resolution, 4800 - won't see much difference
inkscape --export-png=reduce_out_1200.png --export-dpi=1200 reduce_temp.svg
inkscape --export-png=reduce_out_2400.png --export-dpi=2400 reduce_temp.svg
inkscape --export-png=reduce_out_4800.png --export-dpi=4800 reduce_temp.svg
convert it to pdf:
convert reduce_out_1200.png reduce_out_1200.pdf
convert reduce_out_2400.png reduce_out_2400.pdf
convert reduce_out_4800.png reduce_out_4800.pdf
Results:
Procedure if you want images inside a PDF with text description, ie. not only plot image in PDF:
This has still one downside, it converts text into raster. It is good for printing, but bad for viewing using PC.
You can see, that it provides (almost) loss-less conversion even on 1200DPI, 1500% scale:
Also, it keeps size of image, 100% scale:
Procedure for text + image + fixed view in computer