uTools-Manuals/docs/php/ps_begin_page.html
2019-04-28 19:00:34 +08:00

139 lines
5.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Start a new page</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.ps-begin-page" class="refentry">
<div class="refnamediv">
<h1 class="refname">ps_begin_page</h1>
<p class="verinfo">(PECL ps &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">ps_begin_page</span> &mdash; <span class="dc-title">Start a new page</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.ps-begin-page-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>ps_begin_page</strong></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$psdoc</code></span>
, <span class="methodparam"><span class="type">float</span> <code class="parameter">$width</code></span>
, <span class="methodparam"><span class="type">float</span> <code class="parameter">$height</code></span>
) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
Starts a new page. Although the parameters <code class="parameter">width</code>
and <code class="parameter">height</code> imply a different page size for each
page, this is not possible in PostScript. The first call of
<span class="function"><strong>ps_begin_page()</strong></span> 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 <span class="function"><strong>ps_begin_page()</strong></span> no
call of <span class="function"><a href="ps_findfont.html" class="function">ps_findfont()</a></span>, 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 <span class="function"><a href="ps_findfont.html" class="function">ps_findfont()</a></span> 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
<span class="function"><a href="ps_set_info.html" class="function">ps_set_info()</a></span> to set the info field
<em>BoundingBox</em> and possibly <em>Orientation</em>
before any <span class="function"><a href="ps_findfont.html" class="function">ps_findfont()</a></span> or
<span class="function"><strong>ps_begin_page()</strong></span> calls.
</p>
<blockquote class="note"><p><strong class="note">Note</strong>:
<p class="para">
Up to version 0.2.6 of pslib, this function will always overwrite
the BoundingBox and Orientation, if it has been set before with
<span class="function"><a href="ps_set_info.html" class="function">ps_set_info()</a></span> and <span class="function"><a href="ps_findfont.html" class="function">ps_findfont()</a></span>
has not been called before.
</p>
</p></blockquote>
</div>
<div class="refsect1 parameters" id="refsect1-function.ps-begin-page-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">psdoc</code></dt>
<dd>
<p class="para">
Resource identifier of the postscript file
as returned by <span class="function"><a href="ps_new.html" class="function">ps_new()</a></span>.
</p>
</dd>
<dt>
<code class="parameter">width</code></dt>
<dd>
<p class="para">
The width of the page in pixel, e.g. 596 for A4 format.
</p>
</dd>
<dt>
<code class="parameter">height</code></dt>
<dd>
<p class="para">
The height of the page in pixel, e.g. 842 for A4 format.
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.ps-begin-page-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
成功时返回 <strong><code>TRUE</code></strong> 或者在失败时返回 <strong><code>FALSE</code></strong>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.ps-begin-page-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="ps_end_page.html" class="function" rel="rdfs-seeAlso">ps_end_page()</a> - End a page</span></li>
<li class="member"><span class="function"><a href="ps_findfont.html" class="function" rel="rdfs-seeAlso">ps_findfont()</a> - Loads a font</span></li>
<li class="member"><span class="function"><a href="ps_set_info.html" class="function" rel="rdfs-seeAlso">ps_set_info()</a> - Sets information fields of document</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>