Conversion Toolsmake PDF file size smaller

Information and discussion about output converters related to LaTeX (e.g. dvips, ps2pdf, ...)
Post Reply
daniel.hadar
Posts: 4
Joined: Sun Jun 20, 2010 6:23 am

make PDF file size smaller

Post by daniel.hadar »

Hi,

I'm kind of new to Latex, but was still able to write a paper using TexWork software.

Mt problem is that the PDF file I create it too big. For 73 pages with some figures (just 10 kb png files) it's about 800 kb.

I need it to be much smaller, even if it reduce the resolution of it. I saw some codes to convert it, but not sure how to use them, the way I created the PDF was with the TexWork feature.

It's very urgent.

Thank you very much,

D.

Recommended reading 2024:

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

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

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

make PDF file size smaller

Post by josephwright »

TeX can't make the images smaller, although there is some compression to be hand in the way the PDF is constructed internally. At the start of your file adding

Code: Select all

\pdfminorversion=5 
\pdfcompresslevel=9
\pdfobjcompresslevel=2
will get pdfLaTeX to use more compression of certain aspects of the file. This may or may not make a difference: it depends on the file structure.

To make the images smaller you'll need to use an external program. You don't say how big they are to start with, so quite how effective this will be is again unclear. On Windows, I'd go for IrfanView: not so sure about other platforms. It can do things like resize images and resample to reduce resolution.
Joseph Wright
daniel.hadar
Posts: 4
Joined: Sun Jun 20, 2010 6:23 am

Re: make PDF file size smaller

Post by daniel.hadar »

hi,
the figures are graphs i created with matlab, there are 16 figures, each of them is about 10-15kb.

i used the code you gave me, it reduced the file from 854kb to 790kb.

I tries to take all the figures out and then the file is 470kb - with the code.

Is there a code to compress the file even more?

thanks
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

make PDF file size smaller

Post by localghost »

Try a small tool to save your graphs directly as PDF [1]. Perhaps this can help.

As soon as the problem is orted out, please act according to Section 3 of the Board Rules.

[1] MATLAB Central - File detail - save2pdf


Best regards and welcome to the board
Thorsten
daniel.hadar
Posts: 4
Joined: Sun Jun 20, 2010 6:23 am

Re: make PDF file size smaller

Post by daniel.hadar »

i don't think that the graphs are the problem, because as i said, without them, the file is still about 500kb.

Is is possible to compress it more?

thanks
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: make PDF file size smaller

Post by josephwright »

Your file size sounds about right to me. I quickly checked my files: I get about 440 kbi for a 93 page file which is purely text with no complex formatting. Zipping using either .zip or .bz2 only drops it to about 420 kbi, so there really is not much "fat" in the file. I doubt you'll get very far looking for more compression
Joseph Wright
daniel.hadar
Posts: 4
Joined: Sun Jun 20, 2010 6:23 am

Re: make PDF file size smaller

Post by daniel.hadar »

i'm not sure if there is a resolution for a text, but if there is, then is it possible to reduce the resolution, so the file will be smaller?

thanks
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

make PDF file size smaller

Post by josephwright »

No. PDF files don't store the text as bitmaps, but as text plus the relevant font information. So you have 70+ pages of text which is in the PDF. Just the text itself needs quite a bit of space before you include fonts, data structures, etc.
Joseph Wright
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

Re: make PDF file size smaller

Post by T3. »

You may try to use one of the standard pdf fonts like times or palatino (if you haven't done that already). Standard fonts are a part of pdf specs and should not require embedding but I'm not sure how much space that can save (probably not that much).

Cheers,

Tomek
Post Reply