TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Horrifying PDF Experiments

493 pointsby thesephistover 4 years ago

27 comments

THE_PUN_STOPSover 4 years ago
"It might be possible to embed a C compiler into a PDF by compiling it to JS with Emscripten, for example, but then your C compiler has to take input through a plain-text form field and spit its output back through a form field."
评论 #25610369 未加载
评论 #25610710 未加载
评论 #25610020 未加载
评论 #25611072 未加载
评论 #25610813 未加载
radoslawcover 4 years ago
Every time I see Adobe logo somewhere I just cringe a little bit. From the time that you had to have Acrobat Reader installed because most of pdfs created with Acrobat (writer) weren't really compatible with other readers, or that time that everything interactive on the web was in Flash (even our governmental websites for example Social Insurance Institution dropped Flash few days ago). My SO recently bought Adobe Lightroom and low and behold - you cannot install it on case sensitive filesystem (in 2020) and help page says: "well just install it on case insensitive filesystem". I'm quite surprised that they allow file names longer than eight characters, dot and three for file type...
评论 #25612376 未加载
评论 #25621066 未加载
17a9f4a4f4e5b3fover 4 years ago
Our neighbors at the fine journal of POC||GTFO are distinguished in PDF manipulation and polyglots. <a href="https:&#x2F;&#x2F;www.alchemistowl.org&#x2F;pocorgtfo&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.alchemistowl.org&#x2F;pocorgtfo&#x2F;</a>
评论 #25610305 未加载
ChrisMarshallNYover 4 years ago
I had an employee once submit an algorithm document, written in pure Postscript.<p>The charts were actually executable Postscript, running the algorithm.<p>One of the coolest things I ever saw.
评论 #25610207 未加载
评论 #25610178 未加载
pettersover 4 years ago
3D objects in PDFs are cool. My thesis used those in a few places. The PDF would print normally, but you could rotate it when open in Adobe Reader.<p>Getting this to work with Latex was... interesting. I spent a lot of time typesetting as a grad student.
评论 #25609813 未加载
评论 #25610822 未加载
评论 #25609920 未加载
peterburkimsherover 4 years ago
PDF attachments are very useful for lossless steganography. Image-based techniques get lost in recompression (e.g. Save To Camera Roll on an iPhone, or sending via Facebook message). PDF attachments don&#x27;t get lost in that way.<p>Want to include the CSV raw data with your report? Just add it as a PDF attachment.<p>Want to hide a game with your homework? Add it as a PDF attachment. Chrome and Preview on Mac doesn&#x27;t show that it exists, but Firefox can be used to extract the file.<p>It&#x27;s not going to shock anyone to have a 5 MB file as a PDF, but there&#x27;s a lot you can hide in there (MP3s, games, HTML files including more JavaScript, whatever else).<p>On the surface, everyone thinks it&#x27;s just another PDF. But the real data is hiding in plain sight.
评论 #25610348 未加载
评论 #25610182 未加载
sn41over 4 years ago
Related: Postscript is a great stackbased language to learn to program in. A good initial exercise is to write a factorial function:<p><a href="https:&#x2F;&#x2F;www-cdf.fnal.gov&#x2F;offline&#x2F;PostScript&#x2F;BLUEBOOK.PDF" rel="nofollow">https:&#x2F;&#x2F;www-cdf.fnal.gov&#x2F;offline&#x2F;PostScript&#x2F;BLUEBOOK.PDF</a><p><a href="http:&#x2F;&#x2F;paulbourke.net&#x2F;dataformats&#x2F;postscript&#x2F;" rel="nofollow">http:&#x2F;&#x2F;paulbourke.net&#x2F;dataformats&#x2F;postscript&#x2F;</a>
评论 #25611078 未加载
userbinatorover 4 years ago
This is demoscene-worthy.<p><i>and it gets replaced with a basic filled and bordered rectangle.</i><p>...also known as a pixel ;-)
Wowfunhappyover 4 years ago
Not too horrifying: when I open the Breakout PDF in Preview, it just displays a white page.<p>PDFs are a great format if you just ignore the dumb parts. :)
评论 #25612496 未加载
评论 #25614504 未加载
jl6over 4 years ago
PDF&#x2F;A is the true PDF! Strips all the bloat away.
评论 #25612432 未加载
brailsafeover 4 years ago
I worked on two aspects of this in my most recent position. I was responsible for implementing the javascript APIs and the feature of embedded abitrary compressed file attachments in a web based PDF editing SDK according to the lengthy pdf spec. It was an interesting technical challenge and eye-opening experience in terms of what I learned PDFs were capable of, and my immediate concern was some of the stuff this git repo talks about.
lmilcinover 4 years ago
I have written an application in PostScript once.<p>As a newbie developer I decided to use PostScript to generate badges for all our employees. There was a list of employee names in a text file, there was a PostScript file with the program and a Perl script to join them together.<p>The PostScript program would take the names, generate 8 badges per A4 page, scale the name of the employee so that it fits the space perfectly, generate procedural background, etc.
floatingatollover 4 years ago
This PDF triggers stuttering and then a resource-overuse tabkill for me on iOS, which is kind of impressive for a blank page.
GekkePrutserover 4 years ago
This is exactly what I hate about Adobe. They&#x27;re always cramming way too much functionality into their plugins making them too heavy and riddled with security issues.<p>This is like flash player all over again. No way am I going to enable the proper pdf reader for web content view. There&#x27;s a good reason browsers refuse to support all this
评论 #25610583 未加载
craftinatorover 4 years ago
This is one of the clearest examples of feature creep I&#x27;ve ever seen. PDF is, as the name clearly implies, a protocol for portable documents. Yet it has grown over the years to be a defacto form protocol, with capabilities to do way more than a portable document should.
评论 #25612145 未加载
O_H_Eover 4 years ago
Question to OP (thesephist): did you also get to this by checking Omar&#x27;s profile from the TabOS link yesterday?
评论 #25614529 未加载
thehesiodover 4 years ago
we had a collection of these internally in the early 2000s using notes, even mandelbrot sets using embedded ps based fonts. a lot of this comes from dynamic form requirements. the JS engine was from the latest mozilla engine for the time when it came out, spidermonkey.
zelon88over 4 years ago
I&#x27;ve seen companies that use a fair amount of the PDF specification before. One of the most impressive was 3D models and scripted UI elements baked into the document. It kind of made the document look like JSCAD, with an actual 3D model you could manipulate.
ajxsover 4 years ago
I didn&#x27;t expect this to be as &#x27;Horrifying&#x27; as it was. Has anyone written a script yet to identify whether or not a given PDF contains executable script?
评论 #25610947 未加载
评论 #25612544 未加载
评论 #25617831 未加载
wffurrover 4 years ago
The remaining JS API in the Chrome viewer is to support enterprise users with JS form validation.
lukaszkupsover 4 years ago
Flash is dead, long live the pdf!
wejickover 4 years ago
I just knew that Chrome PDF engine was from Foxit. anyone has more detail about this?
评论 #25611472 未加载
vuciv1over 4 years ago
can someone please explain to me the power of embedding a c compiler into a pdf?<p>doesnt a compiler just output executables? would we be able to run these executables? where would these executables get stored?
评论 #25611525 未加载
deadw3ightover 4 years ago
i now know exactly how to show off on college application resumés...think MIT uses Chrome? finally something to make up for my GPA.
评论 #25611246 未加载
kebmanover 4 years ago
The PDF thickens...
djsumdogover 4 years ago
One of my good friends did a lot of research on PDFs as part of his graduate research. Older versions of Adobe Writer (maybe even the current one too?) would always append and never overwrite. So if you edited pages, it would add those edits to the bottom of the file. As long as you did everything in the Writer workflow and didn&#x27;t Save As a new file, you could see a history of old edits. You can even find stuff that&#x27;s blacked out in some government documents.
评论 #25612836 未加载
评论 #25611916 未加载
评论 #25611120 未加载
评论 #25611083 未加载
评论 #25648800 未加载
评论 #25612970 未加载
SV_BubbleTimeover 4 years ago
I was told once by someone in infosec that the PDF spec included a dos emulator for some abstract thing.<p>That doesn’t appear to be true exactly but isn’t anywhere in the realm of impossible which is a serious issue for PDF.<p>I was hoping FoxIt dropped a lot of the BS spec parts, but it seems they don’t want to “lose out” to Acrobat in the features checklist. At least I know it’s easy to turn JS off by GPO with FoxIt, Acrobat I assume too?