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!
Remove pictures from exisiting PDF file |
Post Reply |
Author | |
zeras
Beginner Joined: 29 Aug 13 Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 28 Nov 13 at 7:26PM |
We have a large pdf file with many pictures and respective text for these pictures. For one reason, we don't need pictures inside pdf file.
Therefore question, whether it's possible to delete picture within pdf file to decrease file size of pdf file. Or any other idea? Replace pictures by dummy or decrease resolution of pictures? |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
You need to use the FindImages(), ImageCount(), GetImageID() and ClearImage() functions. ClearImage() will replace the image with a 1x1 single transparent pixel. Andrew.
|
|
zeras
Beginner Joined: 29 Aug 13 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Thanks, that works.
Problem is, that I don't want to delet all pictures. Can I get page number of picture first, so that I can decide to delete or not? |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Zeras, So if you have Image1 in the list and it is drawn on Page 1 and Page 2 but you only want it deleted from Page1 then you will be out of luck with this approach. You can use a different set of QPL functions which will tell you where each image is draw and on what page. You can also the get the ImageID and then call ClearImage. If the image is shared though on page 1 and page 2 then the image will be cleared from both pages. QP.LoadFromFile("99pages.pdf", ""); QP.SelectPage(1); int id = QP.GetPageImageList(0); // Only finds images on the current page. int count = QP.GetImageListCount(id); for (int i = 1; i <= count; i++) { int type = QP.GetImageListItemIntProperty(id, i, 400); int width = QP.GetImageListItemIntProperty(id, i, 401); int height = QP.GetImageListItemIntProperty(id, i, 402); int bpp = QP.GetImageListItemIntProperty(id, i, 403); int cs = QP.GetImageListItemIntProperty(id, i, 404); int ImageId = QP.GetImageListItemIntProperty(id, i, 405); if (width == 200) QP.ClearImage(ImageId); } 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