Re:Embedded PDF viewer in Firefox 81 supports filling forms
by mkl on Tuesday September 22, 2020 @06:31PM
(#24560768)
GP is right. The code that makes up a PDF is text-based. Those images can be encoded in the PDF file using the ASCIIHexDecode filter, i.e. as editable ASCII text code.
[ Parent
| on HN ]
Re:Embedded PDF viewer in Firefox 81 supports filling forms
by yunohn on Wednesday September 23, 2020 @01:07AM
(#24563185)
GP uses the phrases "losslessly convert to text" and "fill in the forms". I think you've misunderstood them, they're clearly talking about the display text, and not the code that comprises it.
Re:Embedded PDF viewer in Firefox 81 supports filling forms
by xfer on Tuesday September 22, 2020 @06:49PM
(#24560918)
Yes just use a hex editor and every data is text-based.
Re:Embedded PDF viewer in Firefox 81 supports filling forms
by mkl on Tuesday September 22, 2020 @08:20PM
(#24561562)
Only the "binary" bits like fonts and bitmap images would need to be hex (and then only so Notepad doesn't mangle them). Everything else in an uncompressed PDF is already text. Go here and download the PDF spec.: https://www.adobe.com/devnet/pdf/pdf_reference.html
Look at Chapter 3, Syntax (and the rest of it, really).
I literally have scripts that use bash and sed, or Python, to modify PDFs by editing the text code. Doing it in Notepad is possible but tricky, as there's a table of object byte offsets near the end that it's easy to mess up by inserting a character.