PS_BEGIN_PAGE(3)

πŸ’– PS_BEGIN_PAGE πŸ’–

okay so bestie, welcome to PS_BEGIN_PAGE(3) β€” yes, that's the whole page title, it's from the Library Functions Manual, and it's literally about starting a brand new page. group chat, settle in. 🫢


✨ NAME ✨

PS_begin_page β€” Start a new page πŸ¦‹


🌸 SYNOPSIS 🌸

#include <pslib.h>

void PS_begin_page(PSDoc *psdoc, float width, float height)

πŸŽ€ DESCRIPTION πŸŽ€

So you wanna start a new page? Say less. This is the function that does it. πŸ’…

Now here's the tea, and it's a little bit of a plot twist: even though width and height look like they let you pick a different page size for every single page… nope. Not possible in PostScript. Not a vibe, just a fact. 😭

The first call of PS_begin_page(3) sets the page size for the whole document. Every call after that? Basically does nothing except make a new page. Iconic but also lowkey useless for resizing.

BUT. It's a whole different story if you're intending to convert the PostScript document into PDF. πŸ‘€ In that case this function drops pdfmarks into the document, and those can set the size for each page individually. So the resulting PDF document will have different page sizes. Slay. ✨

Every page is encapsulated into save/restore, which means most of the settings you made on one page will not be retained on the next page. New page, new you. 🌈

And now the part you actually need to hear, bestie, because this is where people get got: 🚨

If there is up to the first call of PS_begin_page(3) no call of PS_findfont(3), then the header of the PostScript document will be output and the bounding box will be set to the size of the first page.

But if PS_findfont(3) was called before the header has been output already, the document will not have a valid bounding box. πŸ’€

To prevent this, you should set the info field BoundingBox and possibly Orientation before any PS_findfont(3) or PS_begin_page(3) calls.

bestie. set BoundingBox and Orientation FIRST. before PS_findfont(3), before PS_begin_page(3). do not skip this. fr fr. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

  • PS_end_page(3) β€” the sequel, you gotta close the page you opened
  • PS_findfont(3) β€” the font one, and the reason your bounding box might be invalid
  • PS_set_info(3) β€” where you go to set your info fields

πŸ‘‘ AUTHOR πŸ‘‘

This manual page was written by Uwe Steinmann uwe@steinmann.cx. thank you for your service king πŸ«‘πŸ’œ


and that's the whole page, periodt. footer's just echoing PS_BEGIN_PAGE(3) right back at you with no extra source, version or date info attached β€” the manual name's already up top where we put it, so nothing's missing. mwah. πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from