I'm trying to add page labels to a PDF file by modifying the file directly with a text editor.
When I open the PDF in a text editor and save it, without making any changes, the file becomes corrupted and can't be opened by Adobe Reader.
Why does this happen?
The solution that came to my mind is using HEX editor, but that doesn't seem to be a comfortable way of working with files. Is there any other way?
As a text editor, I use Sublime Text.
xpdfandmupdf, so I can't tell you what Windows viewers do. But if the position of the objects changed, the xref table is corrupt and should be regenerated if you want to have a standard-conforming file. – dirkt Dec 01 '16 at 14:59