5 ms·
"somewhat bloated" is the understatement of the century. PDF documents can contain executable code in two different programming languages (JavaScript and PostSc
by tdeck 5y ago
"somewhat bloated" is the understatement of the century. PDF documents can contain executable code in two different programming languages (JavaScript and PostScript), interactive content, digital signatures, their own form of encryption, and more. Why they thought adding JavaScript to an already infamous attack vector of a format is beyond my understanding.
- layer8 5y agoJavascript was added to PDF in order to implement interactive and dynamic forms, including input validation and normalization and dynamically adding/removing form elements based on user interaction. The contents of forms can also be directly submitted to a server. Basically, Adobe didn’t want HTML forms to steal their show, so they implemented the equivalent with PDF. Not saying that was a good idea, but here you go.
- deleted 5y ago[deleted]
- ygra 5y agoPDF can contain executable PostScript? That was new to me. I know the syntax is still PostScript, but without the programming language. Is there a nice description somewhere?
- tdeck 5y agoIt seems that my understanding of this was not correct. I should have checked this before posting it, but I have a vivid memory of some PDF that rendered a different maze each time you opened it using PostScript and that override everything else. Most of what I'm reading suggests that the turing-complete aspects were removed in the design of PDF.
- zauguin 5y agoOld versions of PDF allowed to embed arbitrary PostScript for some area of the page, but this was always specified not to have any effect except if the PDF gets converted to PostScript. Especially it was specified to be ignored by PDF viewers and non PostScript printers, making it rather useless. In current PDF versions, this is no longer allowed.