$gstate->SetStrokeColorSpace(ColorSpace::CreateDeviceRGB()); $gstate->SetStrokeColor(new ColorPt(1.0, 0.0, 0.0)); // red $gstate->SetTransform(0.5, 0.0, 0.0, 0.5, 280.0, 300.0); $gstate->SetLineWidth(20.0); $writer->WritePlacedElement($element); // Draw the same path with with a given dash pattern $element->SetPathFill(false); // this path is should be only stroked $gstate->SetStrokeColor(new ColorPt(0.0, 0.0, 1.0)); // blue $gstate->SetTransform(0.5, 0.0, 0.0, 0.5, 280.0, 0.0); $gstate->SetDashPattern(array(30.0), 0); $writer->WritePlacedElement($element); // Use the path as a clipping path $writer->WriteElement($builder->CreateGroupBegin()); // Save the graphics state // Start constructing the new path (the old path was lost when we created // a new Element using CreateGroupBegin()). $builder->PathBegin(); $builder->MoveTo(306, 396); $builder->CurveTo(681, 771, 399.75, 864.75, 306, 771); $builder->CurveTo(212.25, 864.75, -69, 771, 306, 396); $builder->ClosePath(); $element = $builder->PathEnd(); // path is now constructed $element->SetPathClip(true); // this path is a clipping path $element->SetPathStroke(true); // this path should be filled and stroked $gstate = $element->GetGState();