Sophie

Sophie

distrib > PLD > ac > amd64 > media > dist > by-pkgid > dd8ef74e7a184506d40e4328053fb785 > files > 3811

php-manual-ro-20051028-1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>ClibPDF Functions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Documentaþia funcþiilor"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="method_exists"
HREF="function.method-exists.html"><LINK
REL="NEXT"
TITLE="cpdf_add_annotation"
HREF="function.cpdf-add-annotation.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-2"></HEAD
><BODY
CLASS="reference"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.method-exists.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.cpdf-add-annotation.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.cpdf"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>X. ClibPDF Functions</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN12295"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="cpdf.intro"
>Introducere</A
></H1
><P
>&#13;     ClibPDF lets you create PDF documents with PHP. ClibPDF functionality
     and API are similar to <A
HREF="ref.pdf.html"
>PDFlib</A
>.
     This documentation should be read alongside the ClibPDF manual since it
     explains the library in much greater detail.
    </P
><P
>&#13;     Many functions in the native ClibPDF and the PHP module, as well
     as in <A
HREF="ref.pdf.html"
>PDFlib</A
>, have the same name.
     All functions except for <A
HREF="function.cpdf-open.html"
><B
CLASS="function"
>cpdf_open()</B
></A
> take the
     handle for the document as their first parameter.
    </P
><P
>&#13;     Currently this handle is not used internally since ClibPDF does
     not support the creation of several PDF documents at the same time.
     Actually, you should not even try it, the results are unpredictable. I
     can't oversee what the consequences in a multi threaded environment
     are. According to the author of ClibPDF this will change in one of
     the next releases (current version when this was written is 1.10).
     If you need this functionality use the pdflib module.
    </P
><P
>&#13;     A nice feature of ClibPDF (and <A
HREF="ref.pdf.html"
>PDFlib</A
>) is the ability to create the pdf
     document completely in memory without using temporary files. It
     also provides the ability to pass coordinates in a predefined unit
     length. (This feature can also be simulated by
     <A
HREF="function.pdf-translate.html"
><B
CLASS="function"
>pdf_translate()</B
></A
> when using the <A
HREF="ref.pdf.html"
>PDFlib</A
> functions.)
    </P
><P
>&#13;     Another nice feature of ClibPDF is the fact that any page can be modified
     at any time even if a new page has been already opened. The function
     <A
HREF="function.cpdf-set-current-page.html"
><B
CLASS="function"
>cpdf_set_current_page()</B
></A
> allows to leave the current
     page and presume modifying an other page.
    </P
><P
>&#13;     Most of the functions are fairly easy to use. The most difficult part
     is probably creating a very simple PDF document at all. The following
     example should help you to get started. It creates a document
     with one page. The page contains the text "Times-Roman" in an
     outlined 30pt font. The text is underlined.
    </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Not&#227;: </B
>
      If you're interested in alternative free PDF generators that do not
      utilize external PDF libraries, see <A
HREF="faq.using.html#faq.using.freepdf"
>&#13;      this related FAQ</A
>.
     </P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="cpdf.requirements"
>Necesitãþi</A
></H1
><P
>&#13;     In order to use the ClibPDF functions you need to install the ClibPDF
     package. It is available for download from <A
HREF="http://www.fastio.com/"
TARGET="_top"
>&#13;     FastIO</A
>, but requires that you purchase a license for commercial
     use. PHP requires that you use cpdflib &#62;= 2.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="cpdf.installation"
>Instalare</A
></H1
><P
>&#13;  To get these functions to work, you have to compile PHP with
  <VAR
CLASS="option"
>--with-cpdflib[=DIR]</VAR
>. DIR is the cpdflib
  install directory, defaults to <TT
CLASS="filename"
>/usr</TT
>. In addition you
  can specify the jpeg library and the tiff library for ClibPDF to use. To do
  so add to your configure line the options
  <VAR
CLASS="option"
>--with-jpeg-dir[=DIR]</VAR
>
  <VAR
CLASS="option"
>--with-tiff-dir[=DIR]</VAR
>.
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="cpdf.configuration"
>Configurare la rulare</A
></H1
><P
>Aceastã extensie nu defineºte directive
de configurare.</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="cpdf.constants"
>Constante predefinite</A
></H1
><P
>&#13;Aceste constante sunt definite de aceastã extensie ºi
vor fi disponibile doar cînd extensia a fost fie
compilatã odatã la instalarea PHP fie dacã extensia este încãrcatã
dinamic la rulare.</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><TT
CLASS="constant"
><B
>CPDF_PM_NONE</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>CPDF_PM_OUTLINES</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>CPDF_PM_THUMBS</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>CPDF_PM_FULLSCREEN</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>CPDF_PL_SINGLE</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>CPDF_PL_1COLUMN</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>CPDF_PL_2LCOLUMN</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>CPDF_PL_2RCOLUMN</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="cpdf.examples"
>Exemple</A
></H1
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN12382"
></A
><P
><B
>Exemplu 1. Simple ClibPDF Example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />$cpdf </font><font color="#007700">= </font><font color="#0000BB">cpdf_open</font><font color="#007700">(</font><font color="#0000BB">0</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_page_init</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">595</font><font color="#007700">, </font><font color="#0000BB">842</font><font color="#007700">, </font><font color="#0000BB">1.0</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_add_outline</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#DD0000">"Page 1"</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_begin_text</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_set_font</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">, </font><font color="#DD0000">"Times-Roman"</font><font color="#007700">, </font><font color="#0000BB">30</font><font color="#007700">, </font><font color="#DD0000">"WinAnsiEncoding"</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_set_text_rendering</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_text</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">, </font><font color="#DD0000">"Times Roman outlined"</font><font color="#007700">, </font><font color="#0000BB">50</font><font color="#007700">, </font><font color="#0000BB">50</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_end_text</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_moveto</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">, </font><font color="#0000BB">50</font><font color="#007700">, </font><font color="#0000BB">50</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_lineto</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">, </font><font color="#0000BB">740</font><font color="#007700">, </font><font color="#0000BB">330</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_stroke</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_finalize_page</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_finalize</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">);<br /></font><font color="#0000BB">Header</font><font color="#007700">(</font><font color="#DD0000">"Content-type: application/pdf"</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_output_buffer</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_close</font><font color="#007700">(</font><font color="#0000BB">$cpdf</font><font color="#007700">);<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
><P
>&#13;     The pdflib distribution contains a more complex example which creates a
     series of pages with an analog clock. Here is that example converted
     into PHP using the ClibPDF extension:
    </P
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN12386"
></A
><P
><B
>Exemplu 2. pdfclock example from pdflib 2.0 distribution</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />$radius </font><font color="#007700">= </font><font color="#0000BB">200</font><font color="#007700">;<br /></font><font color="#0000BB">$margin </font><font color="#007700">= </font><font color="#0000BB">20</font><font color="#007700">;<br /></font><font color="#0000BB">$pagecount </font><font color="#007700">= </font><font color="#0000BB">40</font><font color="#007700">;<br /><br /></font><font color="#0000BB">$pdf </font><font color="#007700">= </font><font color="#0000BB">cpdf_open</font><font color="#007700">(</font><font color="#0000BB">0</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_set_creator</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#DD0000">"pdf_clock.php"</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_set_title</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#DD0000">"Analog Clock"</font><font color="#007700">);<br />&nbsp;&nbsp;<br />while (</font><font color="#0000BB">$pagecount</font><font color="#007700">-- &gt; </font><font color="#0000BB">0</font><font color="#007700">) {<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_page_init</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$pagecount</font><font color="#007700">+</font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">2 </font><font color="#007700">* (</font><font color="#0000BB">$radius </font><font color="#007700">+ </font><font color="#0000BB">$margin</font><font color="#007700">), </font><font color="#0000BB">2 </font><font color="#007700">* (</font><font color="#0000BB">$radius </font><font color="#007700">+ </font><font color="#0000BB">$margin</font><font color="#007700">), </font><font color="#0000BB">1.0</font><font color="#007700">);<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_set_page_animation</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">4</font><font color="#007700">, </font><font color="#0000BB">0.5</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">);&nbsp;&nbsp;</font><font color="#FF8000">/* wipe */<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_translate</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$radius </font><font color="#007700">+ </font><font color="#0000BB">$margin</font><font color="#007700">, </font><font color="#0000BB">$radius </font><font color="#007700">+ </font><font color="#0000BB">$margin</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_save</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_setrgbcolor</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">, </font><font color="#0000BB">1.0</font><font color="#007700">);<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</font><font color="#FF8000">/* minute strokes */<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_setlinewidth</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">2.0</font><font color="#007700">);<br />&nbsp;&nbsp;for (</font><font color="#0000BB">$alpha </font><font color="#007700">= </font><font color="#0000BB">0</font><font color="#007700">; </font><font color="#0000BB">$alpha </font><font color="#007700">&lt; </font><font color="#0000BB">360</font><font color="#007700">; </font><font color="#0000BB">$alpha </font><font color="#007700">+= </font><font color="#0000BB">6</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">cpdf_rotate</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">6.0</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">cpdf_moveto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">cpdf_lineto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">-</font><font color="#0000BB">$margin</font><font color="#007700">/</font><font color="#0000BB">3</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">cpdf_stroke</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_restore</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_save</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /> <br />&nbsp;&nbsp;</font><font color="#FF8000">/* 5 minute strokes */<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_setlinewidth</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">3.0</font><font color="#007700">);<br />&nbsp;&nbsp;for (</font><font color="#0000BB">$alpha </font><font color="#007700">= </font><font color="#0000BB">0</font><font color="#007700">; </font><font color="#0000BB">$alpha </font><font color="#007700">&lt; </font><font color="#0000BB">360</font><font color="#007700">; </font><font color="#0000BB">$alpha </font><font color="#007700">+= </font><font color="#0000BB">30</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">cpdf_rotate</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">30.0</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">cpdf_moveto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">cpdf_lineto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">-</font><font color="#0000BB">$margin</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">cpdf_stroke</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;</font><font color="#0000BB">$ltime </font><font color="#007700">= </font><font color="#0000BB">getdate</font><font color="#007700">();<br /><br />&nbsp;&nbsp;</font><font color="#FF8000">/* draw hour hand */<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_save</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_rotate</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, -((</font><font color="#0000BB">$ltime</font><font color="#007700">[</font><font color="#DD0000">'minutes'</font><font color="#007700">]/</font><font color="#0000BB">60.0</font><font color="#007700">) + </font><font color="#0000BB">$ltime</font><font color="#007700">[</font><font color="#DD0000">'hours'</font><font color="#007700">] - </font><font color="#0000BB">3.0</font><font color="#007700">) * </font><font color="#0000BB">30.0</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_moveto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, -</font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">10</font><font color="#007700">, -</font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">20</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_lineto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">2</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_lineto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, -</font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">10</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">20</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_closepath</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_fill</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_restore</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /><br />&nbsp;&nbsp;</font><font color="#FF8000">/* draw minute hand */<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_save</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_rotate</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, -((</font><font color="#0000BB">$ltime</font><font color="#007700">[</font><font color="#DD0000">'seconds'</font><font color="#007700">]/</font><font color="#0000BB">60.0</font><font color="#007700">) + </font><font color="#0000BB">$ltime</font><font color="#007700">[</font><font color="#DD0000">'minutes'</font><font color="#007700">] - </font><font color="#0000BB">15.0</font><font color="#007700">) * </font><font color="#0000BB">6.0</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_moveto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, -</font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">10</font><font color="#007700">, -</font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">20</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_lineto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$radius </font><font color="#007700">* </font><font color="#0000BB">0.8</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_lineto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, -</font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">10</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">20</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_closepath</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_fill</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_restore</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /><br />&nbsp;&nbsp;</font><font color="#FF8000">/* draw second hand */<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_setrgbcolor</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">1.0</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_setlinewidth</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">2</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_save</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_rotate</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, -((</font><font color="#0000BB">$ltime</font><font color="#007700">[</font><font color="#DD0000">'seconds'</font><font color="#007700">] - </font><font color="#0000BB">15.0</font><font color="#007700">) * </font><font color="#0000BB">6.0</font><font color="#007700">));<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_moveto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, -</font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">5</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_lineto</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">, </font><font color="#0000BB">0.0</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_stroke</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_restore</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /><br />&nbsp;&nbsp;</font><font color="#FF8000">/* draw little circle at center */<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_circle</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">$radius</font><font color="#007700">/</font><font color="#0000BB">30</font><font color="#007700">);<br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_fill</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /><br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_restore</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /><br />&nbsp;&nbsp;</font><font color="#0000BB">cpdf_finalize_page</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#0000BB">$pagecount</font><font color="#007700">+</font><font color="#0000BB">1</font><font color="#007700">);<br />}<br /><br /></font><font color="#0000BB">cpdf_finalize</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /></font><font color="#0000BB">Header</font><font color="#007700">(</font><font color="#DD0000">"Content-type: application/pdf"</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_output_buffer</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /></font><font color="#0000BB">cpdf_close</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">);<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="cpdf.seealso"
>Vezi, de asemenea,</A
></H1
><P
>&#13;     See also the <A
HREF="ref.pdf.html"
>PDFlib</A
>
     extension documentation.
    </P
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>Cuprins</B
></DT
><DT
><A
HREF="function.cpdf-add-annotation.html"
>cpdf_add_annotation</A
>&nbsp;--&nbsp;Adds annotation</DT
><DT
><A
HREF="function.cpdf-add-outline.html"
>cpdf_add_outline</A
>&nbsp;--&nbsp;Adds bookmark for current page</DT
><DT
><A
HREF="function.cpdf-arc.html"
>cpdf_arc</A
>&nbsp;--&nbsp;Draws an arc</DT
><DT
><A
HREF="function.cpdf-begin-text.html"
>cpdf_begin_text</A
>&nbsp;--&nbsp;Starts text section</DT
><DT
><A
HREF="function.cpdf-circle.html"
>cpdf_circle</A
>&nbsp;--&nbsp;Draw a circle</DT
><DT
><A
HREF="function.cpdf-clip.html"
>cpdf_clip</A
>&nbsp;--&nbsp;Clips to current path</DT
><DT
><A
HREF="function.cpdf-close.html"
>cpdf_close</A
>&nbsp;--&nbsp;Closes the pdf document</DT
><DT
><A
HREF="function.cpdf-closepath-fill-stroke.html"
>cpdf_closepath_fill_stroke</A
>&nbsp;--&nbsp;Close, fill and stroke current path</DT
><DT
><A
HREF="function.cpdf-closepath-stroke.html"
>cpdf_closepath_stroke</A
>&nbsp;--&nbsp;Close path and draw line along path</DT
><DT
><A
HREF="function.cpdf-closepath.html"
>cpdf_closepath</A
>&nbsp;--&nbsp;Close path</DT
><DT
><A
HREF="function.cpdf-continue-text.html"
>cpdf_continue_text</A
>&nbsp;--&nbsp;Output text in next line</DT
><DT
><A
HREF="function.cpdf-curveto.html"
>cpdf_curveto</A
>&nbsp;--&nbsp;Draws a curve</DT
><DT
><A
HREF="function.cpdf-end-text.html"
>cpdf_end_text</A
>&nbsp;--&nbsp;Ends text section</DT
><DT
><A
HREF="function.cpdf-fill-stroke.html"
>cpdf_fill_stroke</A
>&nbsp;--&nbsp;Fill and stroke current path</DT
><DT
><A
HREF="function.cpdf-fill.html"
>cpdf_fill</A
>&nbsp;--&nbsp;Fill current path</DT
><DT
><A
HREF="function.cpdf-finalize-page.html"
>cpdf_finalize_page</A
>&nbsp;--&nbsp;Ends page</DT
><DT
><A
HREF="function.cpdf-finalize.html"
>cpdf_finalize</A
>&nbsp;--&nbsp;Ends document</DT
><DT
><A
HREF="function.cpdf-global-set-document-limits.html"
>cpdf_global_set_document_limits</A
>&nbsp;--&nbsp;Sets document limits for any pdf document</DT
><DT
><A
HREF="function.cpdf-import-jpeg.html"
>cpdf_import_jpeg</A
>&nbsp;--&nbsp;Opens a JPEG image</DT
><DT
><A
HREF="function.cpdf-lineto.html"
>cpdf_lineto</A
>&nbsp;--&nbsp;Draws a line</DT
><DT
><A
HREF="function.cpdf-moveto.html"
>cpdf_moveto</A
>&nbsp;--&nbsp;Sets current point</DT
><DT
><A
HREF="function.cpdf-newpath.html"
>cpdf_newpath</A
>&nbsp;--&nbsp;Starts a new path</DT
><DT
><A
HREF="function.cpdf-open.html"
>cpdf_open</A
>&nbsp;--&nbsp;Opens a new pdf document</DT
><DT
><A
HREF="function.cpdf-output-buffer.html"
>cpdf_output_buffer</A
>&nbsp;--&nbsp;Outputs the pdf document in memory buffer</DT
><DT
><A
HREF="function.cpdf-page-init.html"
>cpdf_page_init</A
>&nbsp;--&nbsp;Starts new page</DT
><DT
><A
HREF="function.cpdf-place-inline-image.html"
>cpdf_place_inline_image</A
>&nbsp;--&nbsp;Places an image on the page</DT
><DT
><A
HREF="function.cpdf-rect.html"
>cpdf_rect</A
>&nbsp;--&nbsp;Draw a rectangle</DT
><DT
><A
HREF="function.cpdf-restore.html"
>cpdf_restore</A
>&nbsp;--&nbsp;Restores formerly saved environment</DT
><DT
><A
HREF="function.cpdf-rlineto.html"
>cpdf_rlineto</A
>&nbsp;--&nbsp;Draws a line</DT
><DT
><A
HREF="function.cpdf-rmoveto.html"
>cpdf_rmoveto</A
>&nbsp;--&nbsp;Sets current point</DT
><DT
><A
HREF="function.cpdf-rotate-text.html"
>cpdf_rotate_text</A
>&nbsp;--&nbsp;
     Sets text rotation angle
    </DT
><DT
><A
HREF="function.cpdf-rotate.html"
>cpdf_rotate</A
>&nbsp;--&nbsp;Sets rotation</DT
><DT
><A
HREF="function.cpdf-save-to-file.html"
>cpdf_save_to_file</A
>&nbsp;--&nbsp;Writes the pdf document into a file</DT
><DT
><A
HREF="function.cpdf-save.html"
>cpdf_save</A
>&nbsp;--&nbsp;Saves current environment</DT
><DT
><A
HREF="function.cpdf-scale.html"
>cpdf_scale</A
>&nbsp;--&nbsp;Sets scaling</DT
><DT
><A
HREF="function.cpdf-set-action-url.html"
>cpdf_set_action_url</A
>&nbsp;--&nbsp;
     Sets hyperlink
    </DT
><DT
><A
HREF="function.cpdf-set-char-spacing.html"
>cpdf_set_char_spacing</A
>&nbsp;--&nbsp;Sets character spacing</DT
><DT
><A
HREF="function.cpdf-set-creator.html"
>cpdf_set_creator</A
>&nbsp;--&nbsp;Sets the creator field in the pdf document</DT
><DT
><A
HREF="function.cpdf-set-current-page.html"
>cpdf_set_current_page</A
>&nbsp;--&nbsp;Sets current page</DT
><DT
><A
HREF="function.cpdf-set-font-directories.html"
>cpdf_set_font_directories</A
>&nbsp;--&nbsp;
     Sets directories to search when using external fonts
    </DT
><DT
><A
HREF="function.cpdf-set-font-map-file.html"
>cpdf_set_font_map_file</A
>&nbsp;--&nbsp;
     Sets fontname to filename translation map when using external fonts
    </DT
><DT
><A
HREF="function.cpdf-set-font.html"
>cpdf_set_font</A
>&nbsp;--&nbsp;Select the current font face and size</DT
><DT
><A
HREF="function.cpdf-set-horiz-scaling.html"
>cpdf_set_horiz_scaling</A
>&nbsp;--&nbsp;Sets horizontal scaling of text</DT
><DT
><A
HREF="function.cpdf-set-keywords.html"
>cpdf_set_keywords</A
>&nbsp;--&nbsp;Sets the keywords field of the pdf document</DT
><DT
><A
HREF="function.cpdf-set-leading.html"
>cpdf_set_leading</A
>&nbsp;--&nbsp;Sets distance between text lines</DT
><DT
><A
HREF="function.cpdf-set-page-animation.html"
>cpdf_set_page_animation</A
>&nbsp;--&nbsp;Sets duration between pages</DT
><DT
><A
HREF="function.cpdf-set-subject.html"
>cpdf_set_subject</A
>&nbsp;--&nbsp;Sets the subject field of the pdf document</DT
><DT
><A
HREF="function.cpdf-set-text-matrix.html"
>cpdf_set_text_matrix</A
>&nbsp;--&nbsp;Sets the text matrix</DT
><DT
><A
HREF="function.cpdf-set-text-pos.html"
>cpdf_set_text_pos</A
>&nbsp;--&nbsp;Sets text position</DT
><DT
><A
HREF="function.cpdf-set-text-rendering.html"
>cpdf_set_text_rendering</A
>&nbsp;--&nbsp;Determines how text is rendered</DT
><DT
><A
HREF="function.cpdf-set-text-rise.html"
>cpdf_set_text_rise</A
>&nbsp;--&nbsp;Sets the text rise</DT
><DT
><A
HREF="function.cpdf-set-title.html"
>cpdf_set_title</A
>&nbsp;--&nbsp;Sets the title field of the pdf document</DT
><DT
><A
HREF="function.cpdf-set-viewer-preferences.html"
>cpdf_set_viewer_preferences</A
>&nbsp;--&nbsp;
     How to show the document in the viewer
    </DT
><DT
><A
HREF="function.cpdf-set-word-spacing.html"
>cpdf_set_word_spacing</A
>&nbsp;--&nbsp;Sets spacing between words</DT
><DT
><A
HREF="function.cpdf-setdash.html"
>cpdf_setdash</A
>&nbsp;--&nbsp;Sets dash pattern</DT
><DT
><A
HREF="function.cpdf-setflat.html"
>cpdf_setflat</A
>&nbsp;--&nbsp;Sets flatness</DT
><DT
><A
HREF="function.cpdf-setgray-fill.html"
>cpdf_setgray_fill</A
>&nbsp;--&nbsp;Sets filling color to gray value</DT
><DT
><A
HREF="function.cpdf-setgray-stroke.html"
>cpdf_setgray_stroke</A
>&nbsp;--&nbsp;Sets drawing color to gray value</DT
><DT
><A
HREF="function.cpdf-setgray.html"
>cpdf_setgray</A
>&nbsp;--&nbsp;Sets drawing and filling color to gray value</DT
><DT
><A
HREF="function.cpdf-setlinecap.html"
>cpdf_setlinecap</A
>&nbsp;--&nbsp;Sets linecap parameter</DT
><DT
><A
HREF="function.cpdf-setlinejoin.html"
>cpdf_setlinejoin</A
>&nbsp;--&nbsp;Sets linejoin parameter</DT
><DT
><A
HREF="function.cpdf-setlinewidth.html"
>cpdf_setlinewidth</A
>&nbsp;--&nbsp;Sets line width</DT
><DT
><A
HREF="function.cpdf-setmiterlimit.html"
>cpdf_setmiterlimit</A
>&nbsp;--&nbsp;Sets miter limit</DT
><DT
><A
HREF="function.cpdf-setrgbcolor-fill.html"
>cpdf_setrgbcolor_fill</A
>&nbsp;--&nbsp;Sets filling color to rgb color value</DT
><DT
><A
HREF="function.cpdf-setrgbcolor-stroke.html"
>cpdf_setrgbcolor_stroke</A
>&nbsp;--&nbsp;Sets drawing color to rgb color value</DT
><DT
><A
HREF="function.cpdf-setrgbcolor.html"
>cpdf_setrgbcolor</A
>&nbsp;--&nbsp;Sets drawing and filling color to rgb color value</DT
><DT
><A
HREF="function.cpdf-show-xy.html"
>cpdf_show_xy</A
>&nbsp;--&nbsp;Output text at position</DT
><DT
><A
HREF="function.cpdf-show.html"
>cpdf_show</A
>&nbsp;--&nbsp;Output text at current position</DT
><DT
><A
HREF="function.cpdf-stringwidth.html"
>cpdf_stringwidth</A
>&nbsp;--&nbsp;Returns width of text in current font</DT
><DT
><A
HREF="function.cpdf-stroke.html"
>cpdf_stroke</A
>&nbsp;--&nbsp;Draw line along path</DT
><DT
><A
HREF="function.cpdf-text.html"
>cpdf_text</A
>&nbsp;--&nbsp;Output text with parameters</DT
><DT
><A
HREF="function.cpdf-translate.html"
>cpdf_translate</A
>&nbsp;--&nbsp;Sets origin of coordinate system</DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.method-exists.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Acas&#227;</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.cpdf-add-annotation.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>method_exists</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>Sus</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>cpdf_add_annotation</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>