Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Pdf_Style Class Reference

Public Member Functions

 __construct ($anotherStyle=null)
 
 setFillColor (Zend_Pdf_Color $color)
 
 setLineColor (Zend_Pdf_Color $color)
 
 setLineWidth ($width)
 
 setLineDashingPattern ($pattern, $phase=0)
 
 setFont (Zend_Pdf_Resource_Font $font, $fontSize)
 
 setFontSize ($fontSize)
 
 getFillColor ()
 
 getLineColor ()
 
 getLineWidth ()
 
 getLineDashingPattern ()
 
 getFont ()
 
 getFontSize ()
 
 getLineDashingPhase ()
 
 instructions ()
 

Detailed Description

Definition at line 33 of file Style.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $anotherStyle = null)

Create style.

Parameters
Zend_Pdf_Style$anotherStyle

Definition at line 96 of file Style.php.

97  {
98  if ($anotherStyle !== null) {
99  $this->_fillColor = $anotherStyle->_fillColor;
100  $this->_color = $anotherStyle->_color;
101  $this->_lineWidth = $anotherStyle->_lineWidth;
102  $this->_lineDashingPattern = $anotherStyle->_lineDashingPattern;
103  $this->_lineDashingPhase = $anotherStyle->_lineDashingPhase;
104  $this->_font = $anotherStyle->_font;
105  $this->_fontSize = $anotherStyle->_fontSize;
106  }
107  }

Member Function Documentation

◆ getFillColor()

getFillColor ( )

Get fill color.

Returns
Zend_Pdf_Color|null

Definition at line 189 of file Style.php.

190  {
191  return $this->_fillColor;
192  }

◆ getFont()

getFont ( )

Get current font.

Returns
Zend_Pdf_Resource_Font $font

Definition at line 230 of file Style.php.

231  {
232  return $this->_font;
233  }

◆ getFontSize()

getFontSize ( )

Get current font size

Returns
float $fontSize

Definition at line 240 of file Style.php.

241  {
242  return $this->_fontSize;
243  }

◆ getLineColor()

getLineColor ( )

Get line color.

Returns
Zend_Pdf_Color|null

Definition at line 199 of file Style.php.

200  {
201  return $this->_color;
202  }

◆ getLineDashingPattern()

getLineDashingPattern ( )

Get line dashing pattern

Returns
array

Definition at line 219 of file Style.php.

220  {
221  return $this->_lineDashingPattern;
222  }

◆ getLineDashingPhase()

getLineDashingPhase ( )

Get line dashing phase

Returns
float

Definition at line 250 of file Style.php.

251  {
252  return $this->_lineDashingPhase->value;
253  }

◆ getLineWidth()

getLineWidth ( )

Get line width.

Returns
float

Definition at line 209 of file Style.php.

210  {
211  return $this->_lineWidth->value;
212  }

◆ instructions()

instructions ( )

Dump style to a string, which can be directly inserted into content stream

Returns
string

Definition at line 261 of file Style.php.

262  {
263  $instructions = '';
264 
265  if ($this->_fillColor !== null) {
266  $instructions .= $this->_fillColor->instructions(false);
267  }
268 
269  if ($this->_color !== null) {
270  $instructions .= $this->_color->instructions(true);
271  }
272 
273  if ($this->_lineWidth !== null) {
274  $instructions .= $this->_lineWidth->toString() . " w\n";
275  }
276 
277  if ($this->_lineDashingPattern !== null) {
278  #require_once 'Zend/Pdf/Element/Array.php';
279  $dashPattern = new Zend_Pdf_Element_Array();
280 
281  #require_once 'Zend/Pdf/Element/Numeric.php';
282  foreach ($this->_lineDashingPattern as $dashItem) {
283  $dashElement = new Zend_Pdf_Element_Numeric($dashItem);
284  $dashPattern->items[] = $dashElement;
285  }
286 
287  $instructions .= $dashPattern->toString() . ' '
288  . $this->_lineDashingPhase->toString() . " d\n";
289  }
290 
291  return $instructions;
292  }
$instructions

◆ setFillColor()

setFillColor ( Zend_Pdf_Color  $color)

Set fill color.

Parameters
Zend_Pdf_Color$color

Definition at line 115 of file Style.php.

116  {
117  $this->_fillColor = $color;
118  }

◆ setFont()

setFont ( Zend_Pdf_Resource_Font  $font,
  $fontSize 
)

Set current font.

Parameters
Zend_Pdf_Resource_Font$font
float$fontSize

Definition at line 168 of file Style.php.

169  {
170  $this->_font = $font;
171  $this->_fontSize = $fontSize;
172  }

◆ setFontSize()

setFontSize (   $fontSize)

Modify current font size

Parameters
float$fontSize

Definition at line 179 of file Style.php.

180  {
181  $this->_fontSize = $fontSize;
182  }

◆ setLineColor()

setLineColor ( Zend_Pdf_Color  $color)

Set line color.

Parameters
Zend_Pdf_Color$color

Definition at line 125 of file Style.php.

126  {
127  $this->_color = $color;
128  }

◆ setLineDashingPattern()

setLineDashingPattern (   $pattern,
  $phase = 0 
)

Set line dashing pattern

Parameters
array$pattern
float$phase

Definition at line 148 of file Style.php.

149  {
150  #require_once 'Zend/Pdf/Page.php';
152  $pattern = array();
153  $phase = 0;
154  }
155 
156  #require_once 'Zend/Pdf/Element/Numeric.php';
157  $this->_lineDashingPattern = $pattern;
158  $this->_lineDashingPhase = new Zend_Pdf_Element_Numeric($phase);
159  }
const LINE_DASHING_SOLID
Definition: Page.php:108
$pattern
Definition: website.php:22

◆ setLineWidth()

setLineWidth (   $width)

Set line width.

Parameters
float$width

Definition at line 135 of file Style.php.

136  {
137  #require_once 'Zend/Pdf/Element/Numeric.php';
138  $this->_lineWidth = new Zend_Pdf_Element_Numeric($width);
139  }

The documentation for this class was generated from the following file: