ps_begin_page
(PECL ps >= 1.1.0)
ps_begin_page — Start a new page
Description
$psdoc
, float $width
, float $height
) : bool
Starts a new page. Although the parameters width
and height
imply a different page size for each
page, this is not possible in PostScript. The first call of
ps_begin_page() will set the page size for the whole
document. Consecutive calls will have no effect, except for creating a new
page. The situation is different if you intent to convert the PostScript
document into PDF. This function places pdfmarks into the document which
can set the size for each page indiviually. The resulting PDF document will
have different page sizes.
Though PostScript does not know different page sizes, pslib places a bounding box for each page into the document. This size is evaluated by some PostScript viewers and will have precedence over the BoundingBox in the Header of the document. This can lead to unexpected results when you set a BoundingBox whose lower left corner is not (0, 0), because the bounding box of the page will always have a lower left corner (0, 0) and overwrites the global setting.
Each page is encapsulated into save/restore. This means, that most of the settings made on one page will not be retained on the next page.
If there is up to the first call of ps_begin_page() no call of ps_findfont(), then the header of the PostScript document will be output and the bounding box will be set to the size of the first page. The lower left corner of the bounding box is set to (0, 0). If ps_findfont() was called before, then the header has been output already, and the document will not have a valid bounding box. In order to prevent this, one should call ps_set_info() to set the info field BoundingBox and possibly Orientation before any ps_findfont() or ps_begin_page() calls.
Note:
Up to version 0.2.6 of pslib, this function will always overwrite the BoundingBox and Orientation, if it has been set before with ps_set_info() and ps_findfont() has not been called before.
Parameters
-
psdoc
-
Resource identifier of the postscript file as returned by ps_new().
-
width
-
The width of the page in pixel, e.g. 596 for A4 format.
-
height
-
The height of the page in pixel, e.g. 842 for A4 format.
See Also
- ps_end_page() - End a page
- ps_findfont() - Loads a font
- ps_set_info() - Sets information fields of document
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-ps-begin-page.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.