0

Can we remove a long narrow clickable bar(with some hidden text and link) at the bottom of each page of this pdf file? When never I click it, it will tries to open a website in my browser.

I prefer to do that from command line, because there may be a pdf file with more pages with such bars.

I tried https://superuser.com/a/536644/9265, but it only can remove the text in the bar, and the bar and the hyperlink still exist.

Thanks.

1
  • Please reupload the example pdf file. I might have a more elegant solution. A very simple python script using pdfrw lib.
    – Ray
    Commented Oct 23, 2023 at 20:46

1 Answer 1

1

I'm not expert of pdf format, but from your example file I believe the unwanted parts are objects 17, 33 and 49. To remove those objects I would use pcregrep in the following way:

pcregrep -aMv '(17|33|49) 0 obj(.|\n)*?Hello(.|\n)*?endobj' new2.pdf > new3.pdf

Here -a option is needed to treat binary file as text, -M to match multiline and -v to invert match.

After that you will still need to repair the new file as described in the answer linked in your question (https://superuser.com/a/536644/9265).

2
  • Thanks. How do you find out "the unwanted parts are objects 17, 33 and 49"?
    – Tim
    Commented Dec 7, 2014 at 0:21
  • @Tim I've opened your file in less and searched for Hello. Then looked around for the some tags.
    – jimmij
    Commented Dec 7, 2014 at 0:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .