Re:Embedded PDF viewer in Firefox 81 supports filling forms
by yjftsjthsd-h on Tuesday September 22, 2020 @03:39PM
(#24558888)
> The default MacOS PDF printer will actually remap the font cmap making born-digital PDFs where the "text" is something else entirely (say "$" maps to "a").
What? Why!? I've heard of doing that as a form of DRM, but I can't imagine Darwin defaulting to doing that.
Re:Embedded PDF viewer in Firefox 81 supports filling forms
by belval on Tuesday September 22, 2020 @04:18PM
(#24559349)
I never dug deeper into it, so I am not aware of why it does that or if it's a specific version or whatnot, but take a PDF from which you can extract the text (with pdftotext/pdfbox for example). Open it in the document viewer and "print" it to PDF. If you extract the text again it is not readable anymore.
This wouldn't be an issue if it was a conscious choice, but when I parsed a lot of born-digital PDFs we ended up with a lot that were like that from various source. Try explaining that...
Re:Embedded PDF viewer in Firefox 81 supports filling forms
by colejohnson66 on Tuesday September 22, 2020 @06:22PM
(#24560686)
Could it be “compacting” the fonts? So if U+0000 to U+0007F aren’t used at all, remove those glyphs and set U+0000’s glyph to be what was U+0080? Yes, I know NULL doesn’t have a glyph, but I hope that gets the idea across.
Re:Embedded PDF viewer in Firefox 81 supports filling forms
by belval on Tuesday September 22, 2020 @07:09PM
(#24561081)
That would be my personal guess yes, as there are other ways to "protect" PDF text like curve-based rendering.
Re:Embedded PDF viewer in Firefox 81 supports filling forms
by Someone on Wednesday September 23, 2020 @06:16AM
(#24565198)
Where did I say PDFs have to be in text format? I said every PDF has an equivalent text-only representation. The format, like postscript and eps started as text-only. Compression, making the files binary was added as an afterthought, to make files smaller (much smaller). If it were binary from the start, its designers would not have made the table of contents at the end waste bytes by writing offsets in ascii.
See http://blog.idrsolutions.com/?s=%22Make+your+own+PDF+file for more info on how to write PDF by hand (also shows why I said you have to be stubborn to do that)
Re:Embedded PDF viewer in Firefox 81 supports filling forms
by belval on Wednesday September 23, 2020 @12:19PM
(#24568711)
"OK, they added various ways of data compression, but PDF is, basically, a text-based format."
You are trying to move the goal post here. The above statement is simply untrue, PDF is not a text based format and it's that simple.
The default MacOS PDF printer will actually remap the font cmap making born-digital PDFs where the "text" is something else entirely (say "$" maps to "a").