Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

PDF lets you run JavaScript (if the PDF viewer doesn’t block it), including on opening a document. Math.random() is available in that environment. JavaScript in PDF allows you to switch the visibility of layers on and off, or to fill the values of text fields. PDF forms sometimes use this to generate likely-unique IDs. Alternatively, PDFs can have embedded PostScript to render contents. PostScript has a random-number function rand built-in. (PostScript support is deprecated in PDF 2.0.)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: