So, I have a program which is kind of a text editor. I need it's output format to be pdf, yet again I need to be able to edit that PDF again. Since my programs output is never very complicated, and since my program is the one who creates the PDF, I could read directly from created PDF, but I thought it would be easier to just attach another file to PDF which will be easier to read.
However, I don't want the user to see that a file is attached to the PDF.
I have read once somewhere that you can trick PDF readers by changing /EmbeddedFiles
to /Embeddedfiles
. That way they will not detect there are files attached to PDF they are processing.
The question is, how can I read the PDF in order to do that change and then again prior to editing to revert it back?
I don't think PDF libraries would help me here, since I'm trying to "corrupt" the PDF. I guess I should parse it as somekind of string and then look for the substring I want to change. But I'm too unfamiliar with the PDF format to know if it's really that simple or is there a specific way to do that...