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