08
Jun
Written by: Jonathan Maron. Stored in: Zend Framework.

There has been a lot of talk about Zend Framework 2.0 in the past few weeks. One of the major new features is the consistent use of namespaces through out the framework. This requires that all components be re-written to take advantage of this PHP 5.3 feature.

Although the release of Zend Framework 2.0 is a long way off — currently there is no official release plan — contributors are encouraged to port their components as soon as possible.

Therefore, I am delighted to announce that you can download a version of \Zend\Service\LiveDocx, complete with the latest development version of Zend Framework 2.0 from my account at GitHub.

In particular, take a look at the shipped demo applications, in the directory /demos/Zend/Service/LiveDocx. They illustrate how to use all parts of the framework and offer a good introduction to the usage of namespaces in PHP 5.3, if this topic is new to you.

To whet your appetite, below is the bitmaps demo:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use Zend\Date\Date;
use Zend\Service\LiveDocx\MailMerge;
 
$mailMerge = new MailMerge();
 
$mailMerge->setUsername('myUsername')
          ->setPassword('myPassword');
 
$mailMerge->setLocalTemplate('template.docx');
 
$mailMerge->assign('software', 'Magic Graphical Compression Suite v1.9')
          ->assign('licensee', 'Daï Lemaitre')
          ->assign('company',  'Megasoft Co-operation')
          ->assign('date',     Date::now()->toString(Date::DATE_LONG))
          ->assign('time',     Date::now()->toString(Date::TIME_LONG))
          ->assign('city',     'Lyon')
          ->assign('country',  'France');
 
$mailMerge->createDocument();
 
// Get all bitmaps
$bitmaps = $mailMerge->getAllBitmaps(100, 'png');      // zoomFactor, format
 
foreach ($bitmaps as $pageNumber => $bitmapData) {
    $filename = sprintf('document-page-%d.png', $pageNumber);
    file_put_contents($filename, $bitmapData);
}
 
unset($mailMerge);

Note, this is development code and should not yet be used in production applications.

Bookmark and Share
25
May
Written by: Jonathan Maron. Stored in: Community.

Jeremy Cook has published a great little article about LiveDocx from his perspective. His opening paragraph really hits the nail on the head and is the main motivation for creating LiveDocx in the first place:

Have you ever tried to create a professional quality document programmatically from within PHP? It’s a real pain and surprisingly tricky to do. There are limited options for PHP developers to produce files in the formats most often used in business. There are libraries for producing PDF files in PHP but they are complex and are difficult to use for producing documents.

Read the full text at:

Bookmark and Share
14
Apr
Written by: Jonathan Maron. Stored in: Events, LiveDocx.

I am delighted to announce that LiveDocx will officially be supporting the next PHP Unconference Europe (PHPucEU). The exact date and venue have yet been announced, but it is expected to be in Spring 2011.

LiveDocx will be deployed by the unconference in their contribution and interests web application. Using this application, unconference participants can register a session that they would like to host, or register an interest in a specific topic. Another unconference participant can then register a session, based upon the original person’s interest.

The LiveDocx powered contribution and interests web application allows the collection of this data and generates the so called vote posters. To decide upon which sessions may actually be hosted, there is a voting process on each morning of the unconference. In this process, participants stick little stickers onto the vote posters. The session advertised on vote posters with the most stickers may then be hosted.

This democratic method of deciding upon which sessions may be hosted is the quintessence of an unconference and the defining difference from a traditional conference: The participants of an unconference decide, on the day, which sessions they would like to have hosted.

LiveDocx is also being used to generate the badges for the unconference. This is a typical mail-merge application and ideally suited to LiveDocx: The badge template, created by a graphic designer, is populated with data in PHP. The data that is inserted into the template (name, organization, blog, WiFi credentials etc.) originates from the database of unconference participants, merged with a database of WiFi credentials.

In each of the above two applications, LiveDocx is used to generate the final documents. One document per PDF file. Additionally, there is a script to concentrate each set of PDF files together, so that the unconference organizers simply need to send two PDF files to the printers to get a hard copy of all the vote posters and badges.

LiveDocx is proud to support PHP Unconference Europe with professional document generation services.

Bookmark and Share