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 - How to resample pdf images to compress pdf size?
  FAQ FAQ  Forum Search   Register Register  Login Login

How to resample pdf images to compress pdf size?

 Post Reply Post Reply
Author
Message
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Topic: How to resample pdf images to compress pdf size?
    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.Clap
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 13 at 2:03PM
We would need to see your code and the PDF to understand what could be happening.

Andrew.
Back to Top
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jun 13 at 6:31AM
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.
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 04 Jun 13 at 3:51AM
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.
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