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!
![]() |
How to resample pdf images to compress pdf size? |
Post Reply ![]() |
Author | |
ExchangeViews ![]() Team Player ![]() ![]() Joined: 13 Mar 12 Status: Offline Points: 38 |
![]() ![]() ![]() ![]() ![]() Posted: 28 May 13 at 8:24AM |
How to resample pdf images to compress pdf size? I extracted one by one image on disk, downsize the quality of JPG using image processing library then replaces the existing image with new one. After that, the file size get increased instead of going to down. Please assist the best way to reduce file size by downsizing the image quality.
Thanks in advance.
![]() |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
We would need to see your code and the PDF to understand what could be happening.
Andrew.
|
|
![]() |
|
ExchangeViews ![]() Team Player ![]() ![]() Joined: 13 Mar 12 Status: Offline Points: 38 |
![]() ![]() ![]() ![]() ![]() |
Dear Andrew thanks for reply. Here is the code i m using:
for J := 1 to ImgCOunt do Begin ImgID:= QP.GetImageID(J); QP.SelectImage(ImgID); if QP.ImageType = 1 then Begin QP.SaveImageToFile('F:\temp.jpg'); ObjImage.IO.LoadFromFileAuto('F:\temp.jpg'); ObjImage.IO.Params.JPEG_Quality:= 40; ObjImage.IO.SaveToFileJpeg('F:\temp.jpg'); QP.ReplaceImage(ImgID, QP.AddImageFromFile('F:\temp.jpg',0)); End; End; QP.SaveToFile('F:\new.pdf'); Is this correct way of reducing the image size? Is there any memory still present in pdf which is increasing file size. Please help me. Thanks in advance.
|
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
Have you tried calling QP.ClearImage(ImageID); which will mostly remove the original image. This line should go after the call to QP.ReplaceImage.
Are you also calling QP.CompressImages(1) at the start of your code.
Andrew. |
|
![]() |
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