How to remove (not extract) all attachment from a pdf on linux with some open source software?
How to remove (not extract) all attachment from a pdf on linux with some open source software?
Could not find how to do it with qpdf
or pdftk
or even a gui tool.
Edit:
Solution pdftk A=oldpdf.pdf cat A output newpdf.pdf
This removes all metadata and also the attachments.
gs -o noimage.pdf -sDEVICE=pdfwrite -dFILTERIMAGE input.pdf
can't test it right now though.
5 0 ReplySlightly shorter:
pdftk old.pdf cat output new.pdf
2 0 ReplyIm interested what people recommend. If you dont find any, what about just printing to another pdf file? Wouldnt that remove attachments?
2 0 ReplyI found much easier solution,
pdftk A=oldpdf.pdf cat A output newpdf.pdf
. This removes all metadata and also the attachments.2 0 Reply
Just a guess, but can LibreOffice open, edit, then save as (or at least print to) PDF?
2 0 ReplyLibreOffice Draw can do that but you have to make sure the font and margins are right or else the formatting gets messed up.
2 0 Reply
Code Industry Master PDF does use open source tools. Sadly source code only available for paid user. 😂
2 0 ReplyYou might try printing the PDF as a PDF.
1 0 ReplyThat worked but it removed bookmarks. I added solution to the post.
1 0 Reply
pdfimages
is what you want, I believe. It's in thepoppler-utils
package in Debian.1 2 ReplySorry, but that is for image extraction.
4 0 Reply