Pdf – Editing PDF via text editor

encodingpdfsublime-text-2sublime-text-3text-editors

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.

Best Answer

Using Notepad++ instead of Sublime Text solved the issue.

Apparently, my Sublime Text made some changes to the file even when it wasn't asked to do so.

Related Question