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 delete unused images from PDF? |
Post Reply |
Author | |
james.si
Beginner Joined: 19 May 06 Location: Slovenia Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 19 May 06 at 1:18PM |
Is there a possibility to delete unused pictures (pictures that are not drawn) from PDF? Please help.
|
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Don't know for sure, but here are some things you might try:
FindImages() / ReplaceImage(). Might be able to replace a big unused image with a tiny one to save space. DeleteLayer(). Might be able to delete a layer with images, assuming they are on a layer by themselves. CheckObjects(). Documentation just says it checks all objects to see if they're valid. Doesn't say whether it removes invalid objects, but may be worth a try. I'm still amazed at the number of functions in this library, and haven't used them all by any means. |
|
swb1
Debenu Quick PDF Library Expert Joined: 05 Dec 05 Location: United States Status: Offline Points: 100 |
Post Options
Thanks(0)
|
I’ve tried a number of things to remove image streams from the PDF and I have not found the means within QuickPDF. I have traced the code and it looks to me as though replace image only replaces the reference to the stream not the stream object itself. It does not look like it would be an enormous challenge to write a function capable of doing this however there may be ramifications of which I am unaware.
sb |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Good to know.
Meanwhile, here's a tool than definitely can remove images: http://www.windjack.com/products/pdfcanopener.html Unfortunately, it also requires Acrobat, so is pretty much out of my price range... |
|
james.si
Beginner Joined: 19 May 06 Location: Slovenia Status: Offline Points: 3 |
Post Options
Thanks(0)
|
reply to chicks: I allready tryed all those things, before I was writing to this forum. I am working on PDF compresion. I replace bmp pictures in PDF with JPG but I can't remove replaced pictures.
|
|
DELBEKE
Debenu Quick PDF Library Expert Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
Post Options
Thanks(0)
|
Have you try an extractpages function after the replacement to create a new Pdf file ?
|
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
I bought NitroPDF on sale at Fry's for $49 last week. Just tried removing an image from a sample PDF, works great! File size went from 132K to 58K.
Boxed version of NitroPDF was out of date, but updated for free with download version released just two days ago. Appears to work well so far... |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
It's also possible to do this manually, if you're not shy about editing PDF files directly. You'll need the free pdftk tool.
Here's an example: http://www.savefile.com/files.php?fid=1846963 1. Uncompress the original PDF using pdftk: pdftk png_example.pdf output step1.pdf uncompress 2. Edit step1.pdf (using commandline edit.exe): Find the object of interest, in this case 5 0 obj. Remove all references to this object by deleting the lines associated with it, including: /XOBJ7BC610 5 0 R /XOBJ7BC610 Do Everything between the line starting with 5 0 obj and endobj Save the edited file to step2.pdf. 3. The xref table in step2.pdf is now corrupt, so we need to fix it. We'll also recompress the PDF: pdftk step2.pdf output step3.pdf compress The final file, step3.pdf, is now a valid, compressed PDF, without the unwanted image (we left the text description below the spot where the image was). We can now use QuickPDF to add a new image in its place. |
|
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