There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

garam ,
@garam@lemmy.my.id avatar

Code Industry Master PDF does use open source tools. Sadly source code only available for paid user. 😂

beejjorgensen ,
@beejjorgensen@lemmy.sdf.org avatar

Slightly shorter:

pdftk old.pdf cat output new.pdf

kleiner_zeh ,

https://stackoverflow.com/questions/20676707/remove-delete-all-images-from-a-pdf-using-ghostscript-or-imagemagick

gs -o noimage.pdf -sDEVICE=pdfwrite -dFILTERIMAGE input.pdf

can't test it right now though.

Schorsch ,

You might try printing the PDF as a PDF.

antihero OP ,

That worked but it removed bookmarks. I added solution to the post.

davidgro ,

Just a guess, but can LibreOffice open, edit, then save as (or at least print to) PDF?

qaz ,

LibreOffice Draw can do that but you have to make sure the font and margins are right or else the formatting gets messed up.

rambos ,

Im interested what people recommend. If you dont find any, what about just printing to another pdf file? Wouldnt that remove attachments?

antihero OP ,

I found much easier solution, pdftk A=oldpdf.pdf cat A output newpdf.pdf. This removes all metadata and also the attachments.

sin_free_for_00_days ,

pdfimages is what you want, I believe. It’s in the poppler-utils package in Debian.

antihero OP ,

Sorry, but that is for image extraction.

worfamerryman ,

I forget exactly what I did, but I think I used okukar. It showed the attachments then it just selected them all and copied them to the desktop.

It might have been one of the web browsers, but I’m pretty sure it was okular as i couldn’t do it on windows.

If you have a better solution, please let me know.

antihero OP ,

I am talking about removing them from pdf. For extracting them this works pdftk [pdf_file.pdf] unpack_files.

Fox ,

I’ve used LibreOffice Draw before to remove content from PDF files without reprinting

antihero OP ,

Yes but in my case the pdf file is big and I libreoffice draw hangs. Also i found another solution (added that to post).

worfamerryman ,

Oh in that case. Let me look up an open source tool I’ve used for PDFs before. It might be able to do it.

It’s called pdfsam.

I’m not sure if it can do what you are asking, but I think it will do the trick.

You might be able to use the convert function of ffmpeg to extract the pages as png and then recreate a new pdf from the pngs that were extracted, but this may not work for your specific file.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines