I have some sewing patterns that I would like to share (and hopefully swap) but all of the PDFs have a

“This was purchased by John Doe john.doe@email.com #ordernumber - if you are not John Doe, please dob in the person you got this from to company@example.com so we can sick our lawyers on them”

sorta footer on every single page.

Obviously for privacy reasons (and because I don’t actually want lawyers sicked onto me), I need to remove this footer.

These are often complex PDFs with more than a hundred pages and multiple layers.

I managed to successfully remove the editing password (not user/viewing password, just can’t edit without password) with qpdf --decrypt. But removing that footer has left me at a dead end. I have even tried manually removing every single instance of those footers using Master PDF Editor but saving the file flattened it and you are no longer able to show/hide layers which is essential for correct printing. (Please don’t ask me how many different PDF editors I have tried because it has been so so SO many I have lost count).

Not that I really want to have to manually edit this out on what could amount to over a thousand pages but searching for a command to remove a certain phrase has come up empty. Even Master PDF Editor doesn’t seem to have a bulk remove or search and replace function (just search).

I use Linux btw.

  • Auster@thebrainbin.org
    link
    fedilink
    arrow-up
    13
    ·
    2 days ago

    Iirc, tested it out quite a few years ago, and I had to use a software that would both decompile and recompile the PDF, and while it was decompiled, I had to remove the repeating pattern I didn’t want with something like Notepad++. File got recompiled a bit over 50% bigger iirc, maybe different compression methods, but the pages themselves didn’t seem affected.

    Sadly can’t remember the name of the program I used for compiling and recompiling, only that it’d do both and that I looked for how to remove watermarks from PDFs. Also the program was certainly offline.

    • Auster@thebrainbin.org
      link
      fedilink
      arrow-up
      11
      ·
      2 days ago

      Found a few candidate tools though can test neither now, mutool (part of the mupdf tools), PDFtk, qpdf, pdf2txt (name sounds familiar though it might be memory playing tricks).

      If any of those could be found as a single portable exe around 2020, chances are it is the tool I used for it.

      • I Cast Fist@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 hours ago

        There’s also GhostScript, which feels like advanced tooling for dealing with PDFs. I used it to scale down the images in some game PDFs I have and save as a copy, so that my old phones could actually open them. The Warcrow free PDF from Corvus Belli went from a whopping 623MB to around 111MB. Still way too fucking large for my phones. The PDF for Mantic Firefight went from 65MB to ~20MB.