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.



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).

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.