PS_ADD_BOOKMARK(3)
β¨ PS_ADD_BOOKMARK(3) β¨
Library Functions Manual π bestie we're in the library functions section today, section 3, C-coded and cunty
π NAME π
PS_add_bookmark β add a bookmark to the current page πβ¨
π¦ SYNOPSIS π¦
#include <pslib.h>
int PS_add_bookmark(PSDoc *psdoc, const char *text, int parent, int open)
look at that signature. five things. count them. slay. π
πΈ DESCRIPTION πΈ
Okay so here's the tea β: PS_add_bookmark drops a bookmark onto the current page. That's it, that's the job.
In PDF viewers, bookmarks usually chill on the left side of the page in a hierachical tree π³ (yes, hierarchical, the manpage said it like that, I'm not fixing it, it's part of the vibe). And when you click one? Boom π₯ you jump straight to the page it points at. Main character navigation energy.
π the parameters, bestie
parentβ this is another bookmark, and it becomes the parent of your brand new bookmark. It's giving family tree π«Ά.openβ if this is unequal to zero, the PDF viewer will show that bookmark open. If it's zero, it stays closed. Simple as.
π¨ IMPORTANT VIBE CHECK π¨ the bookmark has no meaning if the document is just printed or viewed. It only does anything when the document gets converted to pdf by either Acrobat Distillerβ’ or Ghostview. So don't come crying to me when your printer doesn't care about your cute little tree π.
β the return value tho
The returned value is a reference for the bookmark. And likeβ¦ it only matters if you're gonna use that bookmark as a parent later. That's its whole purpose. It's the bookmark's nepo-baby moment π.
π RETURN VALUE π
Returns the identifier of the bookmark, or zero if something went wrong π.
The identifier is a positiv number. (Positive. Again: manpage's spelling, not mine. We keep receipts around here fr fr.)
π«Ά so like, zero = error, anything else = you got an ID and you ate.
π SEE ALSO π
the whole linky friend group. go say hi. they're all iconic. iykyk π
π AUTHOR π
This manual page was written by Uwe Steinmann uwe@steinmann.cx. π«‘ thank you for your service, legend.
and that's a wrap on PS_ADD_BOOKMARK(3) from the Library Functions Manual β footer said the same thing twice and honestly? relatable. go forth, add bookmarks, be the tree you wish to see in the world π¦πβ¨
π¦ where this page comes from
- debian bookworm: pslib-dev 0.4.7-1+b1
- debian trixie: pslib-dev 0.4.8-1+b1
- ubuntu jammy: pslib-dev 0.4.7-1
- ubuntu noble: pslib-dev 0.4.7-1build2
- ubuntu questing: pslib-dev 0.4.8-1
- ubuntu resolute: pslib-dev 0.4.8-1build1
- ubuntu stonking: pslib-dev 0.4.8-3 Β· GPL-2.0-or-later OR LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms