<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >pdf_setcolor</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="PDF functions " HREF="ref.pdf.html"><LINK REL="PREVIOUS" TITLE="pdf_set_word_spacing" HREF="function.pdf-set-word-spacing.html"><LINK REL="NEXT" TITLE="pdf_setdash" HREF="function.pdf-setdash.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-2"></HEAD ><BODY CLASS="refentry" 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.pdf-set-word-spacing.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.pdf-setdash.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.pdf-setcolor" ></A >pdf_setcolor</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN89395" ></A ><P > (PHP 4 >= 4.0.5, PHP 5)</P >pdf_setcolor -- Sets fill and stroke color</DIV ><DIV CLASS="refsect1" ><A NAME="AEN89398" ></A ><H2 >Description</H2 >bool <B CLASS="methodname" >pdf_setcolor</B > ( resource pdfdoc, string type, string colorspace, float c1 [, float c2 [, float c3 [, float c4]]])<BR ></BR ><P > Set the current color space and color. Returneazã <TT CLASS="constant" ><B >TRUE</B ></TT > în caz de succes, <TT CLASS="constant" ><B >FALSE</B ></TT > în caz contrar. The parameter <VAR CLASS="parameter" >type</VAR > can be <VAR CLASS="literal" >fill</VAR >, <VAR CLASS="literal" >stroke</VAR > or <VAR CLASS="literal" >both</VAR > to specify that the color is set for filling, stroking or both filling and stroking. The parameter <VAR CLASS="parameter" >colorspace</VAR > can be <VAR CLASS="literal" >gray</VAR >, <VAR CLASS="literal" >rgb</VAR >, <VAR CLASS="literal" >cmyk</VAR >, <VAR CLASS="literal" >spot</VAR > or <VAR CLASS="literal" >pattern</VAR >. The parameters <VAR CLASS="parameter" >c1</VAR >, <VAR CLASS="parameter" >c2</VAR >, <VAR CLASS="parameter" >c3</VAR > and <VAR CLASS="parameter" >c4</VAR > represent the color components for the color space specified by <VAR CLASS="parameter" >colorspace</VAR >. Except as otherwise noted, the color components are floating-point values that range from 0 to 1. </P ><P > For <VAR CLASS="literal" >gray</VAR > only <VAR CLASS="parameter" >c1</VAR > is used. </P ><P > For <VAR CLASS="literal" >rgb</VAR > parameters <VAR CLASS="parameter" >c1</VAR >, <VAR CLASS="parameter" >c2</VAR >, and <VAR CLASS="parameter" >c3</VAR > specify the red, green and blue values respectively. <DIV CLASS="informalexample" ><P ></P ><A NAME="AEN89450" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#FF8000">// Set fill and stroke colors to white.<br /></font><font color="#0000BB">pdf_setcolor</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#DD0000">"both"</font><font color="#007700">, </font><font color="#DD0000">"rgb"</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">);<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ><P ></P ></DIV > </P ><P > For <VAR CLASS="literal" >cmyk</VAR >, parameters <VAR CLASS="parameter" >c1</VAR >, <VAR CLASS="parameter" >c2</VAR >, <VAR CLASS="parameter" >c3</VAR >, and <VAR CLASS="parameter" >c4</VAR > are the cyan, magenta, yellow and black values, respectively. <DIV CLASS="informalexample" ><P ></P ><A NAME="AEN89458" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#FF8000">// Set fill and stroke colors to black.<br /></font><font color="#0000BB">pdf_setcolor</font><font color="#007700">(</font><font color="#0000BB">$pdf</font><font color="#007700">, </font><font color="#DD0000">"both"</font><font color="#007700">, </font><font color="#DD0000">"cmyk"</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">);<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ><P ></P ></DIV > </P ><P > For <VAR CLASS="literal" >spot</VAR >, <VAR CLASS="parameter" >c1</VAR > should be a spot color handles returned by <A HREF="function.pdf-makespotcolor.html" ><B CLASS="function" >pdf_makespotcolor()</B ></A > and <VAR CLASS="parameter" >c2</VAR > is a tint value between 0 and 1. </P ><P > For <VAR CLASS="literal" >pattern</VAR >, <VAR CLASS="parameter" >c1</VAR > should be a pattern handle returned by <A HREF="function.pdf-begin-pattern.html" ><B CLASS="function" >pdf_begin_pattern()</B ></A >. </P ></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.pdf-set-word-spacing.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Acasã</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.pdf-setdash.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >pdf_set_word_spacing</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.pdf.html" ACCESSKEY="U" >Sus</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >pdf_setdash</TD ></TR ></TABLE ></DIV ></BODY ></HTML >