LyXLyx document - smaller PDF file ?

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
fcochard
Posts: 3
Joined: Tue Jan 17, 2012 9:17 am

Lyx document - smaller PDF file ?

Post by fcochard »

Hello all,

I'm wirting a technical documentation with Lyx, and I'm facing a problem: when I generate the PDF file, it is huge (more than 50Mo for 70+ pages). This is due to the high number of pictures, but also to the resolution of the PDF file - I guess 600 dpi. However, I've not been able to find how I can reduce the PDF resolution (150 dpi or even less would be OK).

Any idea ?

I work on Ubuntu 10.10 64bits, with Lyx 1.6.7. I've created my own class.

Many thanks in advance for your help,

Regards,

François

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Lyx document - smaller PDF file ?

Post by Stefan Kottwitz »

Hi François,

welcome to the board!
  • You could try in your document preamble:

    Code: Select all

    \pdfminorversion=5
    \pdfobjcompresslevel=3 
    \pdfcompresslevel=9
    Ir requires PDF readers supporting PDF 1.5.
  • Or have a look at pdfsizeopt.
  • You could also try XeLaTeX instead of pdfLaTeX and compare the results.
Stefan
LaTeX.org admin
fcochard
Posts: 3
Joined: Tue Jan 17, 2012 9:17 am

Re: Lyx document - smaller PDF file ?

Post by fcochard »

Hi Stefan,

Many thanks for your quick reaction !

But... I tried, in vain:
- If I put the given commands in the Lyx preamble, I've an error message : \pdfminorversion cannot be changed after data is written.
- If I put the commands in my class file (.cls file), I've no more error, but the result is similar (more than 50Mo), even if I change the compression value (1 to 9)...

Regarding pdfsizeopt... hum... looks complex to install... (:<).

XeLatex : I don't have this option in the exporting format list (in Lyx)... how can I setup it ?

I hope you can still help (;>)

Regards,

François
fcochard
Posts: 3
Joined: Tue Jan 17, 2012 9:17 am

Lyx document - smaller PDF file ?

Post by fcochard »

Hello all,

I finally found a simple way, using ghostscript to optimize file size.
The command is :

Code: Select all

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf fichierAComprimer.pdf
The result is a file 5x smaller than original one, without visible quality decrease.

I hoped to find a way to generate a smaller file, but this is a valuable workaround for me - until I find a solution at the source.

Regards,

François
Last edited by Stefan Kottwitz on Mon Jan 23, 2012 6:56 pm, edited 1 time in total.
Post Reply