Live data from Hacker News

Show HN: Tetris in a PDF

th0mas.nl

101–110 of 238 posts

Re: Show HN: Tetris in a PDF

#102
post #30
post #23

So it's possible to port C compiler to PDF. Compiler is already done https://github.com/Mati365/ts-c-compiler . We can run DOS in PDF basically..

That's how it inevitably goes with Turing completeness :) The real achievement here arguably isn't running code (that's provided by the PDF spec and implementations), but managing to hook it up to user input/output in an ergonomic-enough way to play Tetris.

The mention of Turing Completeness got me curious, so I looked something up. Behold, a C compiler written in Lambda Calculus: https://github.com/woodrush/lambda-8cc

Re: Show HN: Tetris in a PDF

#103

Earlier quoted context omitted.

I have faced this exact problem with Canadian govt forms. Evince doesn't support them. They are so specific about only adobe acrobat to fill out the forms. I can open them in firefox but can't update them properly The only option is to use my barely hanging on 10-yr old windows machine. Let's hope that eventually they move on to a simpler web form.

Wait, did Acrobat actually end support for Linux? Od you just didn't want that particular machine to catch... capitalism?

There is no recent version of Acrobat Reader for Linux, and old (was it 5.x beta?) versions rarely work on modern distros.

Re: Show HN: Tetris in a PDF

#104

You glorious bastard, what a cool project! This is already a contender for most hacker project of the year :-) (below is not serious) I would advise people against using this in production though because it's still missing some critical features. For example: 1. The Javascript stops working when printed to physical paper. The resulting paper just has a static image and the controls no longer work. 2. It doesn't work…

> The Javascript stops working when printed to physical paper. The resulting paper just has a static image and the controls no longer work.

I believe you need to rescan it into PDF to get it to work again.

Re: Show HN: Tetris in a PDF

#105
post #57
post #20

They also support iframes! The absolute madness of PDFs is a world wonder. But I'm really still not sure we could do without them.

Gzipped PostScript documents were fairly popular during the 90's and are functionally identical to PDFs for 99% of use cases. (PDF is essentially PostScript, but with more features.)

Well, both a simpler language more geared toward presentation, but also including more modern features designed for on-screen viewing.

Re: Show HN: Tetris in a PDF

#106

could you use checkboxes for display? I'm no sure if you can style them, but I think you can access them in JS, and that should result in having basic "pixels" which you can use to draw anything.

I made a game of life in pdf using this technique, but pdf.js is less open to chromium to respect the standard on letting the pdf designer defining the ON and OFF state.

One other way would be to use normal text fields and leveraging custom fonts. I think there are an enormous potential with fonts in the realm of pdf hacking. I think there is also a story of past vuln on pdf.js because fonts were evaluated outside the sandbox.

Re: Show HN: Tetris in a PDF

#107

You glorious bastard, what a cool project! This is already a contender for most hacker project of the year :-) (below is not serious) I would advise people against using this in production though because it's still missing some critical features. For example: 1. The Javascript stops working when printed to physical paper. The resulting paper just has a static image and the controls no longer work. 2. It doesn't work…

> The Javascript stops working when printed to physical paper. The resulting paper just has a static image and the controls no longer work. I believe you need to rescan it into PDF to get it to work again.

It might be possible to set up some kind of pdf quine using e.g. a QR code

Re: Show HN: Tetris in a PDF

#110
post #7

Not just web browsers, Acrobat (and probably other PDF readers) have supported executing Javascript in PDFs for decades.

Which makes sense, why would browsers randomly add JS to PDF if it wasn’t already part of the standard?

What a nightmare that JS is a part of the PDF standard. I suppose that it's optional.
Post reply on HN