📄 function.ps-begin-page.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Start a new page</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ps-arcn.html">ps_arcn</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ps-begin-pattern.html">ps_begin_pattern</a></div> <div class="up"><a href="ref.ps.html">PS Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.ps-begin-page" class="refentry"> <div class="refnamediv"> <h1 class="refname">ps_begin_page</h1> <p class="verinfo">(PECL ps:1.1.0-1.3.5)</p><p class="refpurpose"><span class="refname">ps_begin_page</span> — <span class="dc-title">Start a new page</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><b><b>ps_begin_page</b></b></span> ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$psdoc</tt></span> , <span class="methodparam"><span class="type">float</span> <tt class="parameter">$width</tt></span> , <span class="methodparam"><span class="type">float</span> <tt class="parameter">$height</tt></span> )</div> <p class="para rdfs-comment"> Starts a new page. Although the parameters <i><tt class="parameter">width</tt></i> and <i><tt class="parameter">height</tt></i> imply a different page size for each page, this is not possible in PostScript. The first call of <b>ps_begin_page()</b> 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. </p> <p class="para"> 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. </p> <p class="para"> 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. </p> <p class="para"> If there is up to the first call of <b>ps_begin_page()</b> no call of <a href="function.ps-findfont.html" class="function">ps_findfont()</a>, 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 <a href="function.ps-findfont.html" class="function">ps_findfont()</a> 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 <a href="function.ps-set-info.html" class="function">ps_set_info()</a> to set the info field <i>BoundingBox</i> and possibly <i>Orientation</i> before any <a href="function.ps-findfont.html" class="function">ps_findfont()</a> or <b>ps_begin_page()</b> calls. </p> <blockquote><p><b class="note">Note</b>: Up to version 0.2.6 of pslib, this function will always overwrite the BoundingBox and Orientation, if it has been set before with <a href="function.ps-set-info.html" class="function">ps_set_info()</a> and <a href="function.ps-findfont.html" class="function">ps_findfont()</a> has not been called before. <br /> </p></blockquote> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">psdoc</tt></i></span> <dd> <p class="para"> Resource identifier of the postscript file as returned by <a href="function.ps-new.html" class="function">ps_new()</a>. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">width</tt></i></span> <dd> <p class="para"> The width of the page in pixel, e.g. 596 for A4 format. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">height</tt></i></span> <dd> <p class="para"> The height of the page in pixel, e.g. 842 for A4 format. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure. </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.ps-end-page.html" class="function" rel="rdfs-seeAlso">ps_end_page()</a></li> <li class="member"><a href="function.ps-findfont.html" class="function" rel="rdfs-seeAlso">ps_findfont()</a></li> <li class="member"><a href="function.ps-set-info.html" class="function" rel="rdfs-seeAlso">ps_set_info()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ps-arcn.html">ps_arcn</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ps-begin-pattern.html">ps_begin_pattern</a></div> <div class="up"><a href="ref.ps.html">PS Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -