Print Page | Close Window

Compressings/Compacting PDFs

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3106
Printed Date: 28 Apr 24 at 9:43PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Compressings/Compacting PDFs
Posted By: BobW
Subject: Compressings/Compacting PDFs
Date Posted: 24 Apr 15 at 10:56PM
I had a request recently to shrink a couple of PDFs.  I created some of them.  Others were created by some other process.  Other than TransformFile, I can't think of any feature that will take a PDF and make it smaller.  I did find a website called smallpdf [dot] com that lets you select a PDF then download the smaller version.  I ran a couple of them through it and they did come back quite a bit smaller.  We're now examining them to see if the quality is acceptable.  I would love to do something like this myself and I know I'm going to be asked to.  Is there a method or feature I'm missing?

Bob



Replies:
Posted By: mLipok
Date Posted: 27 Apr 15 at 2:01PM
1. How many pages contain test document ?
2. What was the initial size of the PDF (in KB) ?
3. What was the size after using this  specified page ?
4. Did you try:
Option 10 in ReplaceFonts - Removes embedded fonts if it matches the 14 std fonts


-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600


Posted By: erico
Date Posted: 27 Apr 15 at 3:53PM
TransformFile() may reduce the size of PDFs.

CompressContent(), CompressImages(), CompressFonts() may also help


edit: corrected typo


-------------
Eric O


Posted By: BobW
Date Posted: 28 Apr 15 at 11:10PM
I've tried the following in a quick program:
TransformFile
LoadFromFile
ReplaceFonts(10)
CompressContent()
CompressImages(1)
CompressFonts()
SaveToFile


Description         Original Size       My Program            SmallPDF[dot]Com result
2 page IRS form      289K                  278K                             99K

Single page             1,128K             1,142K                           558K
scanned image
(made by putting
a form on a copier
that emailed me
the PDF)

1 Page PDF I                 116K               120K                               26K             
created with
QuickPDF

In two cases the resulting file is LARGER than the original!  I tried using each of the functions individually -- TransformFile by itself got the first PDF down to 267K, but none of them really did much at all.

This is going to be a bit of a problem for me because I know I'm going to be asked why I can't do what the free website did.


Posted By: erico
Date Posted: 29 Apr 15 at 3:36PM
The size of the scanned image is most closely tied to the dpi resolution of the scanned image. Your best chance there would be to use a lower resolution using SetImageResolution and FitImage as required.

For the other two, without looking at the content, there is really no way to be certain what is increasing the PDF size. It could be almost anything.


-------------
Eric O


Posted By: AndrewC
Date Posted: 06 May 15 at 7:50AM
Bob,

Most programs that reduce PDF file sizes concentrate on re-sampling and re-compressing images within the PDF.  This is usually achieved by reducing the colours in the image, using a different image compression such as lossy JPEG and also lowering the DPI by resampling the image.

I don't believe that SetImageResolution will be much use.   To get this working with Debenu Quick PDF Library you will need to extract the larger images, process them to reduce their size and then use something like ReplaceImage to update the image.

I suspect this is a feature currently on the Debenu TODO list.

Other optimisations may include removing unused character from fonts and then re-compressing them or removing unused objects.  Each of these processes is quite complex and time consuming. 

Andrew



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk