News for hackers. Stuff that matters.
Re:SumatraPDF Reader by hu3 on Monday October 23, 2023 @10:41PM (#37994324)
No joke. Yesterday I found out PDFs can have forms with JavaScript.

https://tcpdf.org/examples/example_014/

How does this even work?

Re:SumatraPDF Reader by lost_tourist on Monday October 23, 2023 @10:48PM (#37994353)
because some viewers have built in javascript interpreters. In the pdf it's just text labelled as a script
Re:SumatraPDF Reader by viraptor on Monday October 23, 2023 @11:41PM (#37994652)
Re:SumatraPDF Reader by hu3 on Tuesday October 24, 2023 @12:31AM (#37994865)
You did amuse me! Thanks!

To me this is the kind of scope creep that causes a "simple" PDF renderer department to end up with 50 devs working in it full-time.

I wonder... can a PDF have an iframe that opens itself? Causing an infinie loop of it loading itself?

Re:SumatraPDF Reader by elashri on Tuesday October 24, 2023 @02:50AM (#37995561)
That's a nice idea. Can we call that PDF bomb?
Re:SumatraPDF Reader by izacus on Tuesday October 24, 2023 @06:25AM (#37997008)
In reality most PDF apps don't support those elements (even software like macOS Preview) and people get along just fine.
Re:SumatraPDF Reader by MilStdJunkie on Tuesday October 24, 2023 @02:34PM (#38003302)
Please please don't mention 3d pdfs. Please. I had to implement this. 3d manipulation in a block inside of a print format that might make deliverables in the hundreds of gigs. It's . . it's one of the dumbest functional requirements I've ever seen, and the fact it exists. . I'm sorry, I have to go be by myself for a while.
Re:SumatraPDF Reader by somat on Tuesday October 24, 2023 @01:19AM (#37995061)
The stupidest part of the whole thing is that pdf is basically a neutered postscript. The problem with postscript as a document format, is that there is no good way to do metadata, jump to a specific page, count pages, etc. So pdf uses the rendering engine of postscript with all that annoying turing complete behavior torn out. Then at some point they wanted some computational capability in the document[1], but instead of reintroducing postscript into the mix they went with a third language, a wierd poorly designed one invent for browser scripting.

1. Yes we all know how stupid this was. but they wanted fillable forms and validating those forms made sense at the time. Really it was because they were trying to compete with the web.

Re:SumatraPDF Reader by baal80spam on Tuesday October 24, 2023 @03:02AM (#37995621)
I remember someone wrote a game in a PDF document...
Re:SumatraPDF Reader by temny on Tuesday October 24, 2023 @03:58PM (#38004570)
Re:SumatraPDF Reader by jimjimjim on Tuesday October 24, 2023 @03:20AM (#37995740)
badly