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!
PDF Size/Quality Control |
Post Reply |
Author | |
vk_rt
Beginner Joined: 29 Jun 11 Status: Offline Points: 6 |
Post Options
Thanks(0)
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
|
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
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?
|
|
vk_rt
Beginner Joined: 29 Jun 11 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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.
|
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
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.
|
|
vk_rt
Beginner Joined: 29 Jun 11 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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)); |
|
vk_rt
Beginner Joined: 29 Jun 11 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
again password is 1234 for the pdf
|
|
vk_rt
Beginner Joined: 29 Jun 11 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Hi Rowan, any other ideas?
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
vk_rt
Beginner Joined: 29 Jun 11 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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.
|
|
engstmalta
Beginner Joined: 24 Jan 11 Location: Malta Status: Offline Points: 2 |
Post Options
Thanks(0)
|
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!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store