I was wondering how to view and edit the code of a PDF file?
By viewing, I don't want to see the binary format, so I think
hexdump
may not be what I want. I triedgedit
, but no encoding method can be used to decode the PDF content.By editing, I would like to search for
/Fit
and change them to/XYZ
by for example sed. But my commandsed s/\/Fit/\/XYZ/ < 1.pdf > 2.pdf
seem not change the appearance of my PDF as I expected, although it doesn't report any error. I was wondering ifsed
can actually work on PDF files as if they were plain text?
The context of my questions can be found from this question. My OS is Ubuntu 10.10.
fix-qdf
program that is part of qpdf. You still have to be a bit careful, though. See http://qpdf.sourceforge.net/files/qpdf-manual.html#ref.qdf – H. Rittich Oct 08 '19 at 12:04fix-qdf
. Hence, if you want to replace a string by a string of different length, it is possible, but you need to use thefix-qdf
tool. I would say, that this is a useful addition to the answer. – H. Rittich Oct 10 '19 at 13:22