SetaPDF_Core_Document_Page_Contents A class representing a pages content

File: /SetaPDF v2/Core/Document/Page/Contents.php

Class hierarchy

Implements

Summary

Properties

$_currentOffset

The current content stream offset

$_currentStream

$_encapsulatedInGraphicState

Flag saying if the content is already encapsulated in a graphic state

$_page

The page object to which this helper instance depends on


Methods

__construct()

_addStream()

protected SetaPDF_Core_Document_Page_Contents::_addStream (
int|null $beforeIndex [, bool $setActive = true [, SetaPDF_Core_Type_IndirectObjectInterface $streamObject = null ]]
): SetaPDF_Core_Type_IndirectObjectInterface

Method for adding streams to the Contents entry.

Parameters
$beforeIndex : int|null
 
$setActive : bool
 
$streamObject : SetaPDF_Core_Type_IndirectObjectInterface
 
Exceptions

Throws SetaPDF_Core_Type_Exception

cleanUp()

Release memory/resources.

clear()

Clears the stream object.

count()

Gets the count of contents streams available for this page.

encapsulateExistingContentInGraphicState()

Encapsulate the existing content stream(s) in separate graphic state operators.

Parameters
$force : bool
 
Exceptions

Throws SetaPDF_Core_Type_Exception

getLastStreamObject()

public SetaPDF_Core_Document_Page_Contents::getLastStreamObject (
[ bool $create = false [, bool $setActive = true ]]
): bool|SetaPDF_Core_Type_Stream

Get and/or create the last stream.

Parameters
$create : bool
 
$setActive : bool
 
Exceptions

Throws SetaPDF_Core_Type_Exception

getStream()

public SetaPDF_Core_Document_Page_Contents::getStream (
[ bool $ignoreFaultyStreams = false ]
): string

Get the stream content.

Parameters
$ignoreFaultyStreams : bool
 

getStreamObject()

Get the stream object.

Parameters
$create : bool
 
Exceptions

Throws SetaPDF_Core_Type_Exception

getStreamObjectByOffset()

public SetaPDF_Core_Document_Page_Contents::getStreamObjectByOffset (
[ int $offset = 0 [, bool $setActive = true ]]
): bool|SetaPDF_Core_Type_Stream

Get a stream by offset in the contents array.

Parameters
$offset : int
 
$setActive : bool
 

isLastStreamActive()

Checks if the last content stream is active.

prependStream()

Prepend a stream to the beginning of the Contents array.

Parameters
$setActive : bool
 
$streamObject : SetaPDF_Core_Type_IndirectObjectInterface
 
Exceptions

Throws SetaPDF_Core_Type_Exception

pushStream()

Append a stream to the end of the Contents array.

Parameters
$setActive : bool
 
$streamObject : SetaPDF_Core_Type_IndirectObjectInterface
 
Exceptions

Throws SetaPDF_Core_Type_Exception

write()

public SetaPDF_Core_Document_Page_Contents::write (
string $bytes
): void

Writes a string to the stream object.

Parameters
$bytes : string
 
Exceptions

Throws SetaPDF_Core_Type_Exception