fixup encoding and remove page numbers