View Full Version : Best Way To Delete Page Numbers?


gtshadow
11-17-2010, 06:36 AM
This isn't specifically a calibre question (although there may be some way of doing what I want with calibre that I don't know of) so I hope it is okay to post this here.

I have a lot of books (mostly pdf files) that have page numbers that I want to get rid of. Going through each book and manually deleting all the page numbers would obviously be way too time consuming, but I have been unable to think up any other way of doing it. Right now, the fastest method I have come up with is using a search and replace feature, but I still would have to manually enter each page number and leave the replace text blank, which isn't very fast at all. I understand that regular expressions can sometimes be used in these situations, but I don't know anything about regular expressions, so I don't know where they would be used or how to make the regex anyway.

So... I am hoping that some people here can tell me the method or methods that they use to accomplish this feat...

Thanks in advance for any help you can give.

janvanmaar
11-17-2010, 07:09 AM
Have a look at header/footer removal in calibre.

gtshadow
11-17-2010, 01:26 PM
Thanks for the reply. I will look into that.:thanks:

Manichean
11-17-2010, 05:30 PM
The manual has a regex tutorial (http://calibre-ebook.com/user_manual/regexp.html) that might be of interest to you.

gtshadow
11-17-2010, 09:48 PM
Thanks for the regex tutorial. After looking at that and other sources I finally have something that does what I want. In case others may see this post and wonder, the regex I came up with is:

Page\s*\d+

This gets rid of the word "Page" and the page numbers after. The only thing it doesn't do is repair breaks in the text where the page numbers were inserted. Still not sure how to do that, but this is a start.

Thanks again for setting me in the right direction.

Manichean
11-18-2010, 04:53 AM
Try looking at the XHTML- markup (use the magic wand symbol) and removing relevant parts of it as well. That might repair the breaks you see.