• NOW LIVE! Into the Woods--new character species, eerie monsters, and haunting villains to populate the woodlands of your D&D games.

[EDUCATIONAL] How to reduce the PDF filesize with free software.

mroberon1972

First Post
Well, thanks to the people in this forum, I have worked out how to reduce the size of a PDF from 13 megs to 2.7 megs using all free software.

First some background:

Some publishing programs, such as old versions of MS Publisher, do not deal with background images well. They tend to place a new image every time it shows up in the PDF. This leads to pages with background images having huge filesizes.

Also, PDF printer drivers like PDF create and PDF995 don't optimise the output at all. They just put in the PDF what the software sends out.

This leads to unusable file sizes in your final PDF.

Get the follow files:

Get the files gs814w32 (Ghostscript) and gsv46w32 (Ghostscript viewer) for your operating system. I advise using google to find them, since the Ghostscript page is slow as slow can be.

Get either PDF995 or one of the other PDF creators that are free.

Now, here is what to do:

Create your book using your best quality image files, add your backgrounds, and generally make the final PRINT version of your book.

Output the monster to PDF995 and wait forever for it to make your file.

Load the PDF into Ghostscript viewer and go to file -> convert.

Under device: pdfwrite
Resolution: Don't bother.

If you just click 'OK' now, it will make an optimised PDF for you with the images being unchanged. If you have backgrounds, you will notice a sudden reduction in file size without graphic quality going down.

If you would like to lower the file size even more, try this:

Click on properties:in the convert screen.

Find DownsampleColorImages, DownsampleGrayImages, and DownsampleMonoImages.

Set them to true.

Find ColorImageResolution, GrayImageResolution, and MonoImageResolution.

Set them to the resolution you like. You will have to experiment with this till you get and acceptable file size / graphic quality ratio.

You can use this to create a pdf version from your print quality version with little to no trouble. Of course, customers would also probably like a special version for printing as well...


That's it for today class...

Dismissed.


Mr. Oberon
"You see, it's all about sharing..."
 
Last edited:

log in or register to remove this ad


mroberon1972 said:
Get either PDF995 or one of the other PDF creators that are free.
If you want, skip this step. Instead, install the Apple Color Laserwriter 12/600 Postscript driver onto your computer. Go into the properties dialog and set the port to FILE:
Output the monster to PDF995 and wait forever for it to make your file.
Print to the Apple printer driver and save to file. In Windows it will append .prn to to the file name.

From the command line, switch directories to the location of the .prn file and run ps2pdf file.prn file.pdf. You may have to edit your path to include the ghostscript directory.

Now, you may ask. Why should I go to all this trouble when there's the nice interface in ghostview? Simple, you can create a batch file with all of the standard things you want to set in all of your PDFs and not have to wander through the dialogs to set them.

For example, one of my batch files (p2p.bat) contains this line:
ps2pdf "-dPDFSETTINGS=/screen" "-dEmbedAllFonts#true" %2 %3 %4 %1.prn %1.pdf

So I can just type:
p2p name
and get a screen version of the PDF. The ghostscript documentation lists all the settings.
 

Good notes for the more tech inclined.

Does your postscript driver have a browse function to set the target directory, or does it just give that simple save testbox?

Also, tried that with Adobe's postscript driver, and the GS viewer crashed with an error when I tried to read the file. I can't advocate that way until I can get it to work. <sigh>
 

mroberon1972 said:
Does your postscript driver have a browse function to set the target directory, or does it just give that simple save testbox?
The Apple print driver comes with Windows (I know XP and ME have it). The save to file option pops up the windows normal Save AS dialog. Just go to the printer control panel and add a printer.
Also, tried that with Adobe's postscript driver, and the GS viewer crashed with an error when I tried to read the file. I can't advocate that way until I can get it to work. <sigh>
You'll notice I did not suggest using the Adobe postscript driver. :) Actually, I don't ever use GhostView so I don't know if the Apple driver will crash it or not. I use the command line as I described.
 

Ok, tried the driver.

First, it lost some lines in the layout. This is not a good thing...

Second, it only gave a save textbox, with no ability to choose a directory without typing it in.

Gonna stick with PDF995 for right now... Others attempts may vary.
 

mroberon1972 said:
Output the monster to PDF995.
Load the PDF into Ghostscript viewer and go to file -> convert.
Under device: pdfwrite
Resolution: Don't bother.

If you just click 'OK' now, it will make an optimised PDF for you with the images being unchanged. If you have backgrounds, you will notice a sudden reduction in file size without graphic quality going down.

If you would like to lower the file size even more, try this:

Click on properties:in the convert screen.

Find DownsampleColorImages, DownsampleGrayImages, and DownsampleMonoImages.

Set them to true.

Find ColorImageResolution, GrayImageResolution, and MonoImageResolution.

Set them to the resolution you like. You will have to experiment with this till you get and acceptable file size / graphic quality ratio.

Ok either I am missing something, or this doesnt work for smaller PDF's. I have a PDF that begins at 1.77Mb that I was hoping to compress. It has a recuring graphical border (MS Word Page Borders) and 3 inserted graphics. When I run this process it actually INCREASES the file to 1.79Mb.

Any hints? I would have thought that even a small file would have had some compression.

Thanks!
 

Prest0 said:
Any chance we can get this sticky'd so we don't lose it?
With the default style you've got a "Thread Tools" menu with "subscribe thread". You can add threads that you want to keep.

It's very useful (especially for "must read this as soon as I have some free time" threads in GD)


Chacal
 

Khaalis said:
Ok either I am missing something, or this doesnt work for smaller PDF's. I have a PDF that begins at 1.77Mb that I was hoping to compress. It has a recuring graphical border (MS Word Page Borders) and 3 inserted graphics. When I run this process it actually INCREASES the file to 1.79Mb.

Any hints? I would have thought that even a small file would have had some compression.

Thanks!

Did you use JPG or BITMAPS as the imported image? It seems to make a differance, as it actually seems to use the image format you use in the PDF.

BMPs seem to take up a lot more space.

Also, what resolution did you use?
 

mroberon1972 said:
Did you use JPG or BITMAPS as the imported image? It seems to make a differance, as it actually seems to use the image format you use in the PDF.

BMPs seem to take up a lot more space.

Also, what resolution did you use?

2 .gifs and a jpg. and 300 resolution. I even tried some of the other recomended settings (like DownsampleGrayImages) but the pictures degraded too much. Any hints would be appreciated. Is it the gifs? Should I convert them to JPG? Thanks!

Edit: Ok. I re-did it with all jpg's and it helped a little but not much. Same 300 resolution and the file is down to 1.71Mb compressed and 1.51Mb zipped.
 
Last edited:

Into the Woods

Remove ads

Top