Hacker News new | past | comments | ask | show | jobs | submit login

How is that pdf made interactive? It has options to toggle the behaviour, which work even in an in browser pdf viewer. I did not think PDFs could do that.





Good question. The github url is printed on the first page.

I find some stuff like this.. is it raw pdf directives? Literally an example of something typst can't do right now. I also can't read this.

``` \def\mt@toggle@sample#1{% \pdfstartlink user{/Subtype/Link /BS << /Type/Border/W 1 /S/D /D[4 1] >> /H/O /C[0.65 0.04 0.07] /Contents(Click to Toggle #1!) %/OC << /Type/OCMD /VE[/Not \csname mt@_compatibility@\endcsname] >> % not honoured by older viewers anyway /A << /S/SetOCGState /State[/Toggle \csname mt@#1@true\endcsname \csname mt@#1@false\endcsname] >>} #1 \hfill\pdfendlink & \mt@layer{#1true}{\rlap{on}}\mt@layer{#1false}{off}} ```


PDFs can do a lot more than show static content. There was one time where Adobe strongly advocated for PDF to be the page format of what would come to be called "The World Wide Web". Where we have HTML now, Adobe wanted PDF. Thankfully that did not happen. But I suspect it would have made more sense technically than [whatever this mess is that we have now.]

A lot of things are possible in PDF.


It’s cool, but using these features severely limits the portability of your document.

These interactive links did not work for me (using Linux) in the in-browser reader in Brave nor in sioyek, but they did work in evince.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: