php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #31376 Function cpdf_fill_stroke() only fills
Submitted: 2005-01-01 21:35 UTC Modified: 2017-01-29 04:22 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sybrendijkstra at gmail dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.0.1 OS: Windows 98 se
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sybrendijkstra at gmail dot com
New email:
PHP Version: OS:

 

 [2005-01-01 21:35 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 18:09 UTC] 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-03-11 11:29 UTC] sybrendijkstra at gmail dot com
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);".
 [2005-05-12 03:08 UTC] yuanchen73 at hotmail dot com
OS: Windows 2000 Server
Version: 5.0.0

Same problem. The stroke doesn't work even I call cpdf_fill() and cpdf_stroke() seperately. I have to redefine the area. For example:
cpdf_rect($cpdf, 55, 546, 60, 24);
cpdf_fill($cpdf);
cpdf_rect($cpdf, 55, 546, 60, 24); // won't work without this line
cpdf_stroke($cpdf);
 [2017-01-20 20:35 UTC] heiglandreas@php.net
-Status: Open +Status: Feedback -Package: Feature/Change Request +Package: *General Issues
 [2017-01-20 20:35 UTC] heiglandreas@php.net
Is this still relevant?
 [2017-01-29 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 19:01:30 2024 UTC