I'm sorry to insist but i'm thinking that maybe my e-mail is being lost 
on the way because this is the third time i'm sending it...

Is this a dumb question? I'm sorry if that's the case.
Anyway, i'm sending it one more time. Any help would be much aprecciated!

With itext i can add attachments to a pdf file and i can also extract
them. However i didn't find a way to remove them from the file, i mean,
i want to delete the attachments of a pdf file so that the file becames
"clean", without attachments but with all the other elements,like text
and images.

I searched, but i only found "ideas" and a code snippet:

public void removeAttachments(PdfReader reader) {   
        PdfDictionary catalog = reader.getCatalog(); 
        PdfDictionary names = 
(PdfDictionary)PdfReader.getPdfObject(catalog.get(PdfName.NAMES));   
        if( names != null)   {
                PdfDictionary files = (PdfDictionary)   
PdfReader.getPdfObject(names.get(PdfName.EMBEDDEDFILES));  
                if( files!= null ){   
                        for( Object key : files.getKeys() ){
                                files.remove((PdfName)key);         
                        }
                reader.removeUnusedObjects();
                }   
        } 
}


but nothing happens when i use this. I used this with the code avaiable
on the itext toolbox to extract attachments.

please help me





------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to