Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Zend_Pdf_Resource_ContentStream Class Reference
Inheritance diagram for Zend_Pdf_Resource_ContentStream:
Zend_Pdf_Resource

Public Member Functions

 __construct ($contentStreamObject='')
 
 addInstructions ($instructions)
 
 getInstructions ()
 
 clear ()
 
 flush ()
 
- Public Member Functions inherited from Zend_Pdf_Resource
 __construct ($resource)
 
 __clone ()
 
 cloneResource ($factory, &$processed)
 
 getResource ()
 
 getFactory ()
 

Protected Attributes

 $_bufferedContent = ''
 
- Protected Attributes inherited from Zend_Pdf_Resource
 $_objectFactory
 
 $_resource
 

Detailed Description

Definition at line 41 of file ContentStream.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $contentStreamObject = '')

Object constructor.

Parameters
Zend_Pdf_Element_Object_Stream | string$contentStreamObject
Exceptions
Zend_Pdf_Exception

Definition at line 56 of file ContentStream.php.

57  {
58  if ($contentStreamObject !== null &&
59  !$contentStreamObject instanceof Zend_Pdf_Element_Object_Stream &&
60  !is_string($contentStreamObject)
61  ) {
62  #require_once 'Zend/Pdf/Exception.php';
63  throw new Zend_Pdf_Exception('Content stream parameter must be a string or stream object');
64  }
65 
66  parent::__construct($contentStreamObject);
67  }

Member Function Documentation

◆ addInstructions()

addInstructions (   $instructions)

Appends instructions to the end of the content stream

Parameters
string$instructions
Returns
Zend_Pdf_Resource_ContentStream

Definition at line 75 of file ContentStream.php.

76  {
77  $this->_bufferedContent .= $instructions;
78  return $this;
79  }
$instructions

◆ clear()

clear ( )

Clear stream content.

Returns
Zend_Pdf_Resource_ContentStream

Definition at line 97 of file ContentStream.php.

98  {
99  $this->_resource->value = '';
100  $this->_bufferedContent = '';
101  return $this;
102  }

◆ flush()

flush ( )

Flush buffered content

Definition at line 107 of file ContentStream.php.

108  {
109  $this->_resource->value .= $this->_bufferedContent;
110  $this->_bufferedContent = '';
111 
112  return $this;
113  }

◆ getInstructions()

getInstructions ( )

Get current stream content

Returns
string

Definition at line 86 of file ContentStream.php.

87  {
88  $this->flush();
89  return $this->_resource->value;
90  }

Field Documentation

◆ $_bufferedContent

$_bufferedContent = ''
protected

Definition at line 48 of file ContentStream.php.


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