News for hackers. Stuff that matters.
Re:TinyVG – an alternative binary encoded vector graphics fo... by jeroenhd on Monday March 20, 2023 @05:33AM (#35229173)
PDF however includes (a subset of) Javascript, making it just as Turing complete.

The spec for PDF 1.7 (dated 2008) is 745 pages long. The more modern PDF 2.0 is not freely available. I'm not willing to spend hundreds of euros to get access to the document, but together with the long list of errata and additional documents linked from the standard body's website, I'm willing to bet it's at least equivalent in length to PostScript.

Re:TinyVG – an alternative binary encoded vector graphics fo... by makapuf on Monday March 20, 2023 @10:49AM (#35232316)
For us laymen, what is fundamentally lacking from svg to handle common PDF use cases ? (Including some multipage svg maybe) ?
Re:TinyVG – an alternative binary encoded vector graphics fo... by jeroenhd on Monday March 20, 2023 @12:46PM (#35234419)
The lack of multipage support is the most obvious distinction, I think, but you could probably add the necessary metadata and render fake borders and boxes to simulate pages if you really wanted to. As far as I know, SVGs cannot contain forms for one example. PDFs can also be digitally signed according to the spec, and they contain DRM provisions.

PDF has a lot of features that I would never think of myself (pronunciation guides, for example) which would require designing a custom solution for in many other formats such as SVG.

If I wanted to render something to be printed and I wanted it to be printed exactly as specified, I would consider PDF (and PostScript) files to be much more reliable than SVG files. SVGs are great for images and icons, but they're simply not designed to do the things PDF was designed to do.

Conversely, PDFs are difficult to embed and require proprietary tools to use most of their less common features, so in many areas they're much worse than SVGs.

Re:TinyVG – an alternative binary encoded vector graphics fo... by mkl on Monday March 20, 2023 @04:54PM (#35238536)
> PDF however includes (a subset of) Javascript, making it just as Turing complete.

Not really, because the JavaScript is quite limited in what it can do (e.g. forms and interactive features). It can't produce text or graphical elements. A PDF reader can show view of a PDF that looks correct even if it doesn't implement any of the JavaScript features.

Re:TinyVG – an alternative binary encoded vector graphics fo... by jeroenhd on Monday March 20, 2023 @05:59PM (#35239372)
Support will vary by viewer, but Chrome's built-in PDF viewer supports a subset of Javascript.

It's enough to play Breakout inside a PDF: https://youtu.be/6rbJu10Telc?t=483