reducing PDF file size in Fedora

Ranjan Maitra maitra.mbox.ignored at inbox.com
Thu Dec 27 16:29:09 UTC 2012


On Thu, 27 Dec 2012 10:41:17 -0500 Bill Davidsen <davidsen at tmr.com>
wrote:

> agraham wrote:
> > Assuming you have source file(s) that are not already PDF, use Open Office and
> > export it as PDF at which point you have all the scaling/compression options
> > available.
> >
> The way to get a smaller file is not to compress what you have, but to generate 
> smaller PDF in the first place. Unfortunately PDF doesn't do a great job of 
> selecting compression options for you, so you have to do the "think work" for 
> it, choose compression (jpeg vs. lz), and such.
> 
> Hint: if you have a lot of graphs, line drawings, and similar, reduce them to 
> b/w (if appropriate) PNG, rather than greyscale and/or jpeg. Pages in b/w can be 
> encoded with jbig and will be tiny compared to almost any other format.

Thanks, I was hoping that there might be a more ready solution but
this (converting all pdf image files to png - and I had north of 50 pdf
files) is exactly what I have now done, using ImageMagick and a perl
script as follows:

#!/usr/bin/perl

use strict;

my @pdfs = `ls *.pdf`;

for my $pdf (@pdfs) {
        chomp $pdf;
        my $file = $pdf;
        $file =~ s/.pdf$//;
        print STDERR "convert $file.pdf $file.png\n";
        `convert $file.pdf $file.png`;
}


Thanks again for all the helpful suggestions! The file size comes down
from 36 MB to 6.4 MB.

Ranjan
-- 
Important Notice: This mailbox is ignored: e-mails are set to be
deleted on receipt. For those needing to send personal or professional
e-mail, please use appropriate addresses.

____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails




More information about the users mailing list