Live data from Hacker News

Show HN: Tetris in a PDF

th0mas.nl

41–50 of 238 posts

Re: Show HN: Tetris in a PDF

#41

Not only web but majorly all OS pdf renderers support JS. It used to be a major source of malware long back.

PDFs are still used to delver malware. Adobe gets picked on less often now since everyone has PDF readers in the browser but that just makes chrome the new target of choice (not that alternative viewers don't get attention too https://thehackernews.com/2024/05/foxit-pdf-reader-flaw-expl...) but what I see most often in malicious PDF files recently are just links to websites that contain malware since they can work no matter what your viewer is.

Re: Show HN: Tetris in a PDF

#44

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…

hahaha I wish you almost didn't include the parenthesis. I've had some clients who would definitely email me that point #1.

Re: Show HN: Tetris in a PDF

#45
post #9

Back in school pdfs would circulate that had a bunch of flash games on them. I have no idea how or who made them, but they let us play dolphin olympics on lab computers with no internet connection.

Excel for games and PowerPoint for stick animations. You'd spend hours in CAD class just creating PowerPoint animations and not doing any CAD. I regret this decision now and wish that I had paid some attention. 3D printers are cool and I have no idea how to design objects for it.

>> I do wish I did pay some attention to CAD now. I want a 3D printer and have no idea how to design objects for it.

Get Solvespace: https://solvespace.com/index.pl

Do the tutorials. If/when you outgrow it, the concepts will carry over to FreeCAD which otherwise has a steeper learning curve but has more capabilities.

Re: Show HN: Tetris in a PDF

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

Re: Show HN: Tetris in a PDF

#47

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."

-- this comment made my me laugh/choke on my coffee and I have no regrets.

Re: Show HN: Tetris in a PDF

#48

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. The resulting paper just has a static image and the controls no longer work."

Just wait until e-paper replaces the real one ;)

Re: Show HN: Tetris in a PDF

#49
post #7

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

I was joking in 2007, when I was working at Siemens, to my boss, that an Excel cell can contain God and the Multiverse when I put an ActiveX inside that was basically a program I made which would draw a 3D animation based on parameters contained on other cells. Let's say the boss was impressed though for me was just basic OLE.

I see from time to time that younger generations reinvent/rediscover the wheel and I chuckle.

Re: Show HN: Tetris in a PDF

#50
post #6

Fortunately this does not work in Safari where the rendering is done natively.

Does not even seem to be a valid PDF according to Preview.app

Preview implements a subset of the full capabilities of PDF, and in particular it does not implement the javascript interpreter.
Post reply on HN