Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - PDF Size/Quality Control
  FAQ FAQ  Forum Search   Register Register  Login Login

PDF Size/Quality Control

 Post Reply Post Reply
Author
Message
vk_rt View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Jun 11
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote vk_rt Quote  Post ReplyReply Direct Link To This Post Topic: PDF Size/Quality Control
    Posted: 30 Jun 11 at 1:52AM
Hi,

I am using importemffromfile function to convert a metafile into pdf format, i am using bitmap image as vector image is not giving me properly formatted pdf. But issue with bitmap or vector image for me is that size of the pdf being generated is too much, for a 50kb emf file I am getting around 2.7mb of pdf with bitmap and 12mb of pdf with vector image for 6 pages. It seems like DPI of pdf is too high.

Is there a way that i can control dpi or quality of pdf while generating pdf, so that i can get pdf file with reasonable size. 

Thanks
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jun 11 at 1:17PM
A PDF does not have any concept of DPI. It's like that the image data is compressed in the EMF and when it's added to the PDF is is uncompressed. Can you upload can example of the EMF and the resulting PDF that we can test?
Back to Top
vk_rt View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Jun 11
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote vk_rt Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jun 11 at 11:08PM
So, does size of pdf only depends on size of emf? Is there any other quality/size/compression factor we can control?

I added 3 examples here :
http://www.raintreeinc.com/files/pdfandemf.rar

PDF's are encrypted with password 1234. These pdf examples i generated are using older version pdf library but functions are same. With new version, i need to change and control size, if possible.
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jul 11 at 10:51AM
Image data and font data can have a big affect on the size of a PDF. For instance, in the PDFs you uploaded (specifically 'Productivity Report Page.pdf'), 99.87% of the file size is caused by image data.

After adding the EMF to the PDF you can try calling CompressImages to see if you can compress the image data that way.
Back to Top
vk_rt View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Jun 11
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote vk_rt Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jul 11 at 9:13PM
Check size of these 2 pdf files, one is generated from pdf library and another using pdf print driver. 

Big difference in file size with same data, 27kb and 1.4Mb

http://www.raintreeinc.com/public/pdf_lib_testsize3page.pdf

I would like to get the file from library to around same size, I tried compressImages but didn't saw any change in file size

          lPDF.CheckError(lPDF.ImportEMFFromStream(lMetafileStream, 1, 1));
          lPDF.CheckError(lPDF.compressimages(1));

Back to Top
vk_rt View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Jun 11
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote vk_rt Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jul 11 at 9:13PM
again password is 1234 for the pdf 
Back to Top
vk_rt View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Jun 11
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote vk_rt Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jul 11 at 8:03PM
Hi Rowan, any other ideas?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jul 11 at 8:18PM
Hi vk_rt!

The large file contains images and the page size is 6597 x 5100 pixels.
The small file contains only text and the page size is 612 x 792 pixels.
So work on the image-properties BEFORE using it for pdf-creation.

Cheers and welcome here,
Ingo


Back to Top
vk_rt View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Jun 11
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote vk_rt Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jul 11 at 2:17AM
How do i decrease image size, to create that small size pdf? As compress images didn't worked out, do i need to use vector image?
I also tried using setimageresolution function, that too didn't helped at all.
Back to Top
engstmalta View Drop Down
Beginner
Beginner


Joined: 24 Jan 11
Location: Malta
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote engstmalta Quote  Post ReplyReply Direct Link To This Post Posted: 30 Sep 11 at 9:57AM
All ImportEMF functions embedd the complete fonts. So far so good. But those fonts are embedded as uncompressed streams not only one of the compress methods manage to compress them!
 
That blows any PDF size generated with EMF out of proportion. What about allowing to compress existing font streams? Or another nice function would be CompressObject(compressiontype). With such a function we could manually search uncompressed objects and compress them.
 
Thanks!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store