Methods

uploadTemplateFromBase64()

uploadTemplateFromBase64(string  $data, string  $templateName) : bool

Upload a base64 encoded template to template storage

Parameters

string $data

Template encoded as base64

string $templateName

Template name

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

bool —

uploadTemplate()

uploadTemplate(string  $templateFilename) : bool

Upload a template to template storage

Parameters

string $templateFilename

Template name

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

bool —

convertDocument()

convertDocument(string  $documentFilename, string  $returnFormat) : string

Convert a document on the local file system to a different format

Parameters

string $documentFilename

Document filename

string $returnFormat

Return format

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

string —

mergeDocument()

mergeDocument(array<int|string,array|bool|int|string>  $mergeData, string  $returnFormat, string  $templateName = '', string  $templateFilename = '', bool  $append = false, array<string,bool|int|string>  $mergeSettings = []) : array<int,string>

Merge data into a template and return an array of binary data.

Each record in the array is the binary data of one document

Parameters

array $mergeData

Array of merge data

string $returnFormat

Return format

string $templateName

Template name

string $templateFilename

Template filename on local file system

bool $append

Append flag

array $mergeSettings

Array of merge settings

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

array

appendDocument()

appendDocument(array<int|string,array|bool|int|string>  $documentsData, string  $returnFormat, array<string,bool|int|string>  $documentSettings = []) : string

Combine documents by appending them, divided by a new section, paragraph or nothing

Parameters

array $documentsData
string $returnFormat
array $documentSettings

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

string —

findAndReplaceDocument()

findAndReplaceDocument(array<string,string>  $findAndReplaceData, string  $returnFormat, string  $templateName = '', string  $templateFilename = '', array<string,bool|int|string>  $mergeSettings = []) : string

Perform find and replace in document and return binary data.

Parameters

array $findAndReplaceData

Array of find and replace data

string $returnFormat

Return format

string $templateName

Template name

string $templateFilename

Template filename on local file system

array $mergeSettings

Array of merge settings

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

string —

getDocumentThumbnails()

getDocumentThumbnails(string  $documentFilename, int  $zoomFactor, int  $fromPage, int  $toPage, string  $imageFormat) : array<int,string>

Generate a thumbnail image per page of specified document filename.

Return an array of binary data with each record containing one thumbnail.

Parameters

string $documentFilename

Document filename

int $zoomFactor

Zoom factor

int $fromPage

From page

int $toPage

To page

string $imageFormat

Image format

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

array

getTrackedChanges()

getTrackedChanges(string  $documentFilename) : array<int|string,array|bool|int|string>

Return the tracked changes in a document.

Parameters

string $documentFilename

Document filename

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

array

removeTrackedChange()

removeTrackedChange(string  $documentFilename, int  $id, bool  $accept) : array<int|string,array|bool|int|string>

Removes a specific tracked change and returns the resulting document.

Parameters

string $documentFilename

Document filename

int $id

The ID of the tracked change that needs to be removed

bool $accept

Specifies whether the tracked change should be accepted or not (reject)

Throws

\TxTextControl\ReportingCloud\Exception\InvalidArgumentException

Returns

array

uri()

uri(string  $uri) : string

Construct URI with version number

Parameters

string $uri

URI

Returns

string —

request()

request(string  $method, string  $uri, array  $options) : \Psr\Http\Message\ResponseInterface

Request the URI with options

Parameters

string $method

HTTP method

string $uri

URI

array $options

Options

Throws

\TxTextControl\ReportingCloud\Exception\RuntimeException

Returns

\Psr\Http\Message\ResponseInterface —

buildFindAndReplaceDataArray()

buildFindAndReplaceDataArray(array  $array) : array

Using passed findAndReplaceData associative array (key-value), build array for backend (list of string arrays)

Parameters

array $array

FindAndReplaceData array

Returns

array —

buildMergeSettingsArray()

buildMergeSettingsArray(array  $array) : array

Using passed mergeSettings array, build array for backend

Parameters

array $array

MergeSettings array

Returns

array —

buildDocumentsArray()

buildDocumentsArray(array  $array) : array

Using passed documentsData array, build array for backend

Parameters

array $array

AppendDocument array

Returns

array —

buildDocumentSettingsArray()

buildDocumentSettingsArray(array  $array) : array

Using passed documentsSettings array, build array for backend

Parameters

array $array

Returns

array —

buildPropertyMapArray()

buildPropertyMapArray(array  $array, \TxTextControl\ReportingCloud\PropertyMap\AbstractPropertyMap  $propertyMap) : array

Using the passed propertyMap, recursively build array

Parameters

array $array

Array

\TxTextControl\ReportingCloud\PropertyMap\AbstractPropertyMap $propertyMap

PropertyMap

Returns

array —

post()

post(string  $uri, array<string,int|string>|array[]  $query = [], mixed  $json = '', int  $statusCode) : mixed

Execute a POST request via REST client

Parameters

string $uri

URI

array|array[] $query

Query

mixed $json

JSON

int $statusCode

Required HTTP status code for response

Returns

mixed —