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.
Slightly shorter:
pdftk old.pdf cat output new.pdf
Im interested what people recommend. If you dont find any, what about just printing to another pdf file? Wouldnt that remove attachments?
I found much easier solution,
pdftk A=oldpdf.pdf cat A output newpdf.pdf
. This removes all metadata and also the attachments.
Just a guess, but can LibreOffice open, edit, then save as (or at least print to) PDF?
LibreOffice Draw can do that but you have to make sure the font and margins are right or else the formatting gets messed up.
Code Industry Master PDF does use open source tools. Sadly source code only available for paid user. 😂
You might try printing the PDF as a PDF.
That worked but it removed bookmarks. I added solution to the post.
pdfimages
is what you want, I believe. It’s in thepoppler-utils
package in Debian.Sorry, but that is for image extraction.