21
Jan
Written by: Jonathan Maron. Stored in: Samples.

In a previous post, we took a look at which file formats are supported by phpLiveDocx.

This information is also available programmatically with the following two static methods. Each returns an array of file formats.

Supported template file formats (input)

1
2
3
4
5
6
7
8
9
$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
$mailMerge->setUsername('myUsername')
          ->setPassword('myPassword');
 
printf("Supported TEMPLATE file formats (input)  : %s.\n",
    arrayDecorator($mailMerge->getTemplateFormats()));
 
unset($mailMerge);

Supported document file formats (output)

1
2
3
4
5
6
7
8
9
$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
$mailMerge->setUsername('myUsername')
          ->setPassword('myPassword');
 
printf("Supported DOCUMENT file formats (output) : %s.\n",
    arrayDecorator($mailMerge->getDocumentFormats()));
 
unset($mailMerge);

Supported image file formats (output)

1
2
3
4
5
6
7
8
9
$mailMerge = new Zend_Service_LiveDocx_MailMerge();
 
$mailMerge->setUsername('myUsername')
          ->setPassword('myPassword');
 
printf("Supported IMAGE file formats (output) : %s.\n",
    arrayDecorator($mailMerge->getImageFormats()));
 
unset($mailMerge);

(arrayDecorator() is a simple function, as described in the previous post.)

These methods are very useful, if you wish to implement a file format validation function.

Leave a Reply