If you have one of those really annoying PDFs where the structure is all crazy or some letters are pictures, etc., it is possible to OCR them with a mask on page numbers.
There are also tools which can just extract the text elements and smush them together, but as others have said, this doesn’t always works as intended.