note 17745 modified in function.pdf-setcolor by felipe

From: Date: Sun, 15 Jun 2008 11:57:31 +0000
Subject: note 17745 modified in function.pdf-setcolor by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-140462@lists.php.net to get a copy of this message
If you encounter errors of the form function 'PDF_setcolor' must not be called in 'path' scope this generally means that you've called the PDFLib functions in the wrong order. For example, the following would be *incorrect* because PDF_rect marks the beginning of the "path scope", and set_color must not be called in path scope: <?php // THIS CODE WILL PRODUCE AN ERROR PDF_rect($pdf,0,0,$width,$height); PDF_setcolor($pdf,$red,$green,$blue); PDF_fill($pdf); <p>The correct order of function calls is as follows: <p>// Correct order of function calls PDF_setcolor($pdf,$red,$green,$blue); PDF_rect($pdf,0,0,$width,$height); PDF_fill($pdf); ?> --was-- <p>If you encounter errors of the form<br> function 'PDF_setcolor' must not be called in 'path' scope<br> this generally means that you've called the PDFLib functions in the wrong order. For example, the following would be *incorrect* because PDF_rect marks the beginning of the "path scope", and set_color must not be called in path scope: <p>// THIS CODE WILL PRODUCE AN ERROR PDF_rect($pdf,0,0,$width,$height); PDF_setcolor($pdf,$red,$green,$blue); PDF_fill($pdf); <p>The correct order of function calls is as follows: <p>// Correct order of function calls PDF_setcolor($pdf,$red,$green,$blue); PDF_rect($pdf,0,0,$width,$height); PDF_fill($pdf); http://php.net/manual/en/function.pdf-setcolor.php

« previous php.notes (#140462) next »