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. setBoundingBoxandOrientationFIRST. beforePS_findfont(3), beforePS_begin_page(3). do not skip this. fr fr. π
π₯ SEE ALSO π₯
PS_end_page(3)β the sequel, you gotta close the page you openedPS_findfont(3)β the font one, and the reason your bounding box might be invalidPS_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
- 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