File: pdf-setcolor.xml

package info (click to toggle)
phpdoc 20050512-1
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 36,592 kB
  • ctags: 1,501
  • sloc: xml: 376,768; php: 6,708; cpp: 500; makefile: 293; perl: 161; sh: 151; awk: 28
file content (103 lines) | stat: -rw-r--r-- 3,896 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/pdf.xml, last change in rev 1.42 -->
  <refentry id="function.pdf-setcolor">
   <refnamediv>
    <refname>pdf_setcolor</refname>
    <refpurpose>Sets fill and stroke color</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>bool</type><methodname>pdf_setcolor</methodname>
      <methodparam><type>resource</type><parameter>pdfdoc</parameter></methodparam>
      <methodparam><type>string</type><parameter>type</parameter></methodparam>
      <methodparam><type>string</type><parameter>colorspace</parameter></methodparam>
      <methodparam><type>float</type><parameter>c1</parameter></methodparam>
      <methodparam><type>float</type><parameter>c2</parameter></methodparam>
      <methodparam><type>float</type><parameter>c3</parameter></methodparam>
      <methodparam><type>float</type><parameter>c4</parameter></methodparam>
     </methodsynopsis>
    <para>
     Set the current color space and color. &return.success;
     The parameter <parameter>type</parameter> can be <literal>fill</literal>,
     <literal>stroke</literal> or <literal>both</literal> to specify that the
     color is set for filling, stroking or both filling and stroking.
     The parameter <parameter>colorspace</parameter> can be
     <literal>gray</literal>, <literal>rgb</literal>,
     <literal>cmyk</literal>, <literal>spot</literal> or
     <literal>pattern</literal>.  The parameters <parameter>c1</parameter>,
     <parameter>c2</parameter>, <parameter>c3</parameter> and
     <parameter>c4</parameter> represent the color components for the color
     space specified by <parameter>colorspace</parameter>. Except as
     otherwise noted, the color components are floating-point values that
     range from 0 to 1.
     Parameters <parameter>c2</parameter>, <parameter>c3</parameter> and
     <parameter>c4</parameter> were optional before PHP 5.
    </para>
    <para>
     For <literal>gray</literal> only <parameter>c1</parameter> is used.
    </para>
    <para>
     For <literal>rgb</literal> parameters <parameter>c1</parameter>,
     <parameter>c2</parameter>, and <parameter>c3</parameter> specify the
     red, green and blue values respectively. 
     <informalexample>
      <programlisting role="php">
<![CDATA[
<?php
// Set fill and stroke colors to white.
pdf_setcolor($pdf, "both", "rgb", 1, 1, 1);
?>
]]>
      </programlisting>
     </informalexample>
    </para>
    <para>
     For <literal>cmyk</literal>, parameters <parameter>c1</parameter>,
     <parameter>c2</parameter>, <parameter>c3</parameter>, and
     <parameter>c4</parameter> are the cyan, magenta, yellow and black
     values, respectively.
     <informalexample>
      <programlisting role="php">
<![CDATA[
<?php
// Set fill and stroke colors to black.
pdf_setcolor($pdf, "both", "cmyk", 0, 0, 0, 1);
?>
]]>
      </programlisting>
     </informalexample>
    </para>
    <para>
     For <literal>spot</literal>, <parameter>c1</parameter> should be
     a spot color handles returned by <function>pdf_makespotcolor</function>
     and <parameter>c2</parameter> is a tint value between 0 and 1.
    </para>
    <para>
     For <literal>pattern</literal>, <parameter>c1</parameter> should be
     a pattern handle returned by <function>pdf_begin_pattern</function>.
    </para>
   </refsect1>
  </refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->