#31376 [Fbk->Opn]: Function cpdf_fill_stroke() only fills
| From: | sybrendijkstra at gmail dot com | Date: | Fri, 11 Mar 2005 10:29:15 +0000 |
| Subject: | #31376 [Fbk->Opn]: Function cpdf_fill_stroke() only fills | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-77343@lists.php.net to get a copy of this message | ||
ID: 31376
User updated by: sybrendijkstra at gmail dot com
Reported By: sybrendijkstra at gmail dot com
-Status: Feedback
+Status: Open
Bug Type: ClibPDF related
Operating System: Windows 98 se
PHP Version: 5.0.1
New Comment:
Hello,
I had some time left and found out that in the PHP source,(
http://chora.php.net/co.php/pecl/cpdf/cpdf.c?php=4291a9959790339708d78fe44745940c&r=1.58.2.1),
around line 1700 i found this:
/* {{{ proto bool cpdf_fill_stroke(int pdfdoc)
Fills and stroke current path */
PHP_FUNCTION(cpdf_fill_stroke)
{
zval **arg1;
int id, type;
CPDFdoc *pdf;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) ==
FAILURE) {
WRONG_PARAM_COUNT;
}
CPDF_FETCH_CPDFDOC(arg1);
cpdf_fill(pdf);
cpdf_stroke(pdf);
RETURN_TRUE;
}
It calls, cpdf_fill() and after that cpdf_stroke(). But in the ClibPDF
manual, cpdfman200.pdf page 19, there is a function "void
cpdf_fillAndStroke(CPDFdoc *pdf);".
Previous Comments:
------------------------------------------------------------------------
[2005-03-06 18:09:09] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2005-01-01 21:35:41] sybrendijkstra at gmail dot com
Description:
------------
I experienced some unexpected results with the CLibPDF function:
cpdf_fill_stroke() ->
http://www.php.net/manual/en/function.cpdf-fill-stroke.php
According to the manual the function is able to fill the current path
and then strokes the same path. As far is i am able to produce that
function only fills and there is no stroking at all to see.
The code below is a convert from a C example from FastI/O
(http://www.fastio.com/example/Arcs.c.txt)
Reproduce code:
---------------
$rbump = 0.1*100;
$xorig = 2.5*100;
$greenblue = 1.0;
$yorig = 7.5*10;
$radius= 2.2*100;
cpdf_setrgbcolor_stroke($cpdf, 0.7, 0.7, 0.0);
for($i=11; $i>=0; $i--) {
$radius -= $rbump;
$greenblue = $i/12.0;
cpdf_setrgbcolor_fill($cpdf, 1.0, $greenblue, $greenblue);
$eangle = ($i+1)*30.0; /* end angle */
$sangle = 0.0;
cpdf_moveto($cpdf, $xorig, $yorig);
cpdf_arc($cpdf, $xorig, $yorig, $radius, $sangle, $eangle, 0);
cpdf_closepath($cpdf);
cpdf_fill_stroke($cpdf); /* fill and stroke */
}
Expected result:
----------------
I expect to see: http://www.fastio.com/example/arctest.pdf
And then the "Color filled pie shapes" image. A red/white background
with a green/yellow lines as pie pieces.
Actual result:
--------------
I actually see only the red/white background. No stroke lines are
visable. I see the same result as when I only use cpdf_fill()
function.
When I saw the source of the .pdf file generated by PHP there where
some minor differences between a file which had cpdf_fill_stroke() and
a file that used only cpdf_fill(). cpdf_fill_stroke() does add
something to the .pdf file, but it's not visable in my PDF viewer
(Adobe Acrobat 5.0).
To be short:
cpdf_fill_stroke() -> only fills (and does not stroke)
cpdf_fill() -> only fills
cpdf_stroke() -> only strokes
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31376&edit=1