I don't do security stuff anymore but I feel chills when I see (great) things like this,
Show HN: Tetris in a PDF
101–110 of 238 posts
Re: Show HN: Tetris in a PDF
#102So 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.
Re: Show HN: Tetris in a PDF
#103Earlier 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?
Re: Show HN: Tetris in a PDF
#104You 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…
I believe you need to rescan it into PDF to get it to work again.
Re: Show HN: Tetris in a PDF
#105They 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.)
Re: Show HN: Tetris in a PDF
#106could 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.
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
#107You 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
#108Took a bit of prompting but was able to get a semi-working (only in Chrome) Flappy Bird out of Claude in ~10 minutes. Seems like the collision detection needs some work :)
https://github.com/baileywjohnson/flapdfy-bird/blob/main/fla...
Re: Show HN: Tetris in a PDF
#109Re: Show HN: Tetris in a PDF
#110Not 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?