Live data from Hacker News

Show HN: Tetris in a PDF

th0mas.nl

51–60 of 238 posts

Re: Show HN: Tetris in a PDF

#51
post #3

Earlier quoted context omitted.

Genius you mean ?

Well, it's quite cool, but if PDF supports javascript, putting a javascript game in a PDF is something obviously possible. I don't know if it qualifies as genius. If the game was made from PostScript commands somehow, that would be genius. Anyway, I love this content on Hacker news, as opposed to people explaining how they want Apple to take their freedom away, because freedom is dangerous.

> as opposed to people explaining how they want Apple to take their freedom away, because freedom is dangerous

May I be the first to reply that I am glad that this works in neither Safari nor Preview.app :)

Re: Show HN: Tetris in a PDF

#52

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…

i recently discovered that the Canadian government depends on this for some fillable forms, because it shows a message at the top that says "JavaScript is disabled" and all the boxes show errors. i couldn't get it to work on Linux and had to dust off a Windows machine (and it still didn't work in firefox, it needed acrobat reader).

Re: Show HN: Tetris in a PDF

#54

This is a good reminder for why to not download random PDFs. One of the mechanisms of the Pegasus spyware was emulating a computer inside a PDF. https://en.wikipedia.org/wiki/Pegasus_(spyware)#Vulnerabilit...

A tetris PDF could be in a 1 pixel iframe right on this page and you'd never know it. So it doesn't require any user action to download one.

Re: Show HN: Tetris in a PDF

#56

Wow, I had no idea PDFs could be this dynamic. Doesn't work in Mac OS preview or quicklook but works great in chrome.

The Canadian passport application PDF has Javascript that updates a QR code in the top-right corner of the first page whenever you change or fill in a field.

https://www.canada.ca/content/dam/ircc/migration/ircc/englis...

Seems like a pretty genius way of avoiding transcription errors. When I dropped my passport application off yesterday the passport officer marked up a few things on the PDF and then scanned it in, so I assume that they use the QR code to automatically fill in the data as I entered it and then make any updates necessary from after-the-fact modifications manually.

Only seemed to work correctly in Acrobat Reader, but I haven't tried others (like Foxit) or anything.

Re: Show HN: Tetris in a PDF

#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.)

Re: Show HN: Tetris in a PDF

#58

"It was a bit tricky to find a union of features that work in both engines [..]" I am curious what the constraints are to make this work and in which environments it does? Does it work in PDF viewers outside the browser? Is there documentation what is available in which environment? What is enabled by default, can be switched on or off?

I guess it should read intersection instead of union.

Oops, yeah :)

Re: Show HN: Tetris in a PDF

#59

This is a good reminder for why to not download random PDFs. One of the mechanisms of the Pegasus spyware was emulating a computer inside a PDF. https://en.wikipedia.org/wiki/Pegasus_(spyware)#Vulnerabilit...

The vulnerability was in images parsing, and exploit was distributed by sending an imessage to the target. So don't open any images, and don't read imessages. They are also known to use browser exploits, so don't visit random websites.

That was sarcasm, in case it's not clear over the internet. Telling people to avoid "suspicious" pdfs/websites is common but ultimately not very useful advice.

The real takeaway is: don't become a target of a nation state intelligence agency. If you own a phone, they can take over it, and there's nothing you can do.

Re: Show HN: Tetris in a PDF

#60

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…

> 1. The Javascript stops working when printed to physical paper.

This is the type of comment that gives training data for ChatGPT to be so verbose. Ha!

Post reply on HN