<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LiveDocx in PHP &#187; Templates</title>
	<atom:link href="http://www.phplivedocx.org/category/templates/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phplivedocx.org</link>
	<description>Zend Framework Implementation of LiveDocx</description>
	<lastBuildDate>Wed, 21 Dec 2011 12:39:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Image Merging with LiveDocx &#8211; ZF 2.0 version</title>
		<link>http://www.phplivedocx.org/2010/10/12/image-merging-with-livedocx-zf-2-0-version/</link>
		<comments>http://www.phplivedocx.org/2010/10/12/image-merging-with-livedocx-zf-2-0-version/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 07:00:16 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[LiveDocx]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=1269</guid>
		<description><![CDATA[Last week, I posted a sample application that shows how to use the new image merging functionality of LiveDocx 2.0. Since then, I have received several requests for a version that uses Zend Framework 2.0. I implemented a Zend Framework 2.0 version of \Zend\Service\LiveDocx\MailMerge in June and have just added LiveDocx 2.0 functionality today. You [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.phplivedocx.org/2010/10/05/image-merging-with-livedocx/">Last week</a>, I posted a sample application that shows how to use the new image merging functionality of LiveDocx 2.0. Since then, I have received several requests for a version that uses Zend Framework 2.0.
<p>I <a href="http://www.phplivedocx.org/2010/06/08/porting-zend_service_livedocx-to-zend-framework-2-0/">implemented</a> a Zend Framework 2.0 version of <em>\Zend\Service\LiveDocx\MailMerge</em> in June and have just added LiveDocx 2.0 functionality today.</p>
<p>You can download the latest version of Zend Framework 2.0, including LiveDocx 2.0 functionality, tests and demonstration applications from my <a href="http://github.com/jonathanmaron/zf2/tree/livedocx-2.0">GitHub</a>.</p>
<p>Take a look at the following directory for a large number of demonstration applications that illustrate all LiveDocx functionality:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">/demos/Zend/Service/LiveDocx/</pre></div></div>

<p>I have sent a pull request to the Zend Framework guys, so you can expect the new code to be included in the main GIT repository shortly.</p>
<p>Below is the Zend Framework 2.0 version of the sample application that I posted last week:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
30
</pre></td><td class="code"><pre class="php">use Zend\<span style="color: #000066;">Date</span>\<span style="color: #000066;">Date</span>;
use Zend\Service\LiveDocx\MailMerge;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span> = <span style="color: #000000; font-weight: bold;">new</span> MailMerge<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setUsername</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'username'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">setPassword</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'password'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$photoFilename</span> = <span style="color: #ff0000;">'dailemaitre.jpg'</span>;
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">imageExists</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$photoFilename</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">uploadImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$photoFilename</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setLocalTemplate</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'template.docx'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'name'</span>,        <span style="color: #ff0000;">'Daï Lemaitre'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'company'</span>,     <span style="color: #ff0000;">'Megasoft Co-operation'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'date'</span>,        <span style="color: #000066;">Date</span>::<span style="color: #006600;">now</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>-&gt;<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">Date</span>::<span style="color: #006600;">DATE_LONG</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'image:photo'</span>, <span style="color: #0000ff;">$photoFilename</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">createDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$document</span> = <span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">retrieveDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'pdf'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
file_put_contents<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'document.pdf'</span>, <span style="color: #0000ff;">$document</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">deleteImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$photoFilename</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000066;">unset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$mailMerge</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2010/10/12/image-merging-with-livedocx-zf-2-0-version/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Image Handling Methods</title>
		<link>http://www.phplivedocx.org/2010/10/06/image-handling-methods/</link>
		<comments>http://www.phplivedocx.org/2010/10/06/image-handling-methods/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 06:25:06 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[LiveDocx]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=1251</guid>
		<description><![CDATA[Following the positive feedback from the blog post yesterday, announcing image merging, I would today like to elaborate a little on the image handling methods of Zend_Service_LiveDocx_MailMerge. They include: getImageImportFormats()Returns an array of supported image formats from which can be imported (lowercase). getImageExportFormats()Returns as array of supported image formats to which can be exported (lowercase). [...]]]></description>
			<content:encoded><![CDATA[<p>Following the positive feedback from the <a href="http://www.phplivedocx.org/2010/10/05/image-merging-with-livedocx/">blog post</a> yesterday, announcing image merging, I would today like to elaborate a little on the image handling methods of <em>Zend_Service_LiveDocx_MailMerge</em>. They include:</p>
<p><em>getImageImportFormats()</em><br />Returns an array of supported image formats from which can be imported (lowercase).</p>
<p><em>getImageExportFormats()</em><br />Returns as array of supported image formats to which can be exported (lowercase).</p>
<p><em>uploadImage($filename)</em><br />Uploads an image file to your account on the LiveDocx backend service.</p>
<p><em>downloadImage($filename)</em><br />Downloads an image file from your account on the LiveDocx backend service.</p>
<p><em>listImages()</em><br />Returns an array of all images that are stored on the LiveDocx backend service.</p>
<p><em>deleteImage($filename)</em><br />Deletes an image file from the LiveDocx backend service.</p>
<p><em>imageExists($filename)</em><br />Checks whether an image file is available on the LiveDocx backend service.</p>
<p>If you are familiar with the <em>Zend_Service_LiveDocx_MailMerge</em> API, you will notice that these methods an very similar to the template handling methods.</p>
<p>The version of <em>Zend_Service_LiveDocx_MailMerge</em> that contains image merging will be released with the next Zend Framework release. For the time being, it is part of the <a href="http://www.phplivedocx.org/2009/12/03/migrated-to-zend-framework-standard-trunk/">Standard Trunk</a> and can be checked out via SVN.</p>
<p>If you wish to try out the above methods, take a look at the following sample applications:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">/demos/Zend/Service/LiveDocx/MailMerge/images/</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2010/10/06/image-handling-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Merging with LiveDocx</title>
		<link>http://www.phplivedocx.org/2010/10/05/image-merging-with-livedocx/</link>
		<comments>http://www.phplivedocx.org/2010/10/05/image-merging-with-livedocx/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 22:21:53 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[LiveDocx]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=1248</guid>
		<description><![CDATA[One of the most commonly requested new features in LiveDocx is the ability to merge images into a template. I am very happy to announce that exactly this feature has been implemented by the backend service. I have updated Zend_Service_LiveDocx_MailMerge to include this new functionality. Image merging is useful, for example, in the case of [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most commonly requested new features in LiveDocx is the ability to merge images into a template. I am very happy to announce that exactly this feature has been implemented by the backend service. I have updated <em>Zend_Service_LiveDocx_MailMerge</em> to include this new functionality.</p>
<p>Image merging is useful, for example, in the case of a badge application for a conference. In addition to a name, company name and date that should appear on the badge, it is possible to insert a photo of the delegate, using the Zend Framework.</p>
<p>Even it is sounds a little counter-intuitive, image merging works with text fields. In fact, inserting a text field for an image is almost identical to inserting a text field for textual information. The only difference is the naming convention of the text field. Whereas, a text field for textual information can have (almost) any identifier, a text field for an image must start with <em>image:</em>. For example: <em>image:photo</em>.</p>
<p>For example, in the case of our badge application, we would have the following 4 fields:</p>
<p><img src="http://www.phplivedocx.org/wp-content/uploads/2010/10/zend.service.livedocx.mailmerge.templates-imagemerge_zoom-300x118.png" width="300" height="118" alt="" /></p>
<p>The text field, into which image data will be inserted is called <em>image:photo</em> and can be populated just like any other text field, using the <em>assign()</em> method. The text fields <em>name</em>, <em>company</em> and <em>date</em> are normal text fields for textual information.</p>
<p>Before an image can be inserted, it first has to be uploaded to your account on the backend LiveDocx server. This can be achieved using the <em>uploadImage($filename)</em> method. We then simply reference the filename in the merge process.</p>
<p>The following code snippet illustrates the flow:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
</pre></td><td class="code"><pre class="php"><span style="color: #0000ff;">$mailMerge</span> = <span style="color: #000000; font-weight: bold;">new</span> Zend_Service_LiveDocx_MailMerge<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setUsername</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'username'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">setPassword</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'password'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$photoFilename</span> = <span style="color: #ff0000;">'dailemaitre.jpg'</span>;
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">imageExists</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$photoFilename</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">uploadImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$photoFilename</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setLocalTemplate</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'template.docx'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'name'</span>,        <span style="color: #ff0000;">'Daï Lemaitre'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'company'</span>,     <span style="color: #ff0000;">'Megasoft Co-operation'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'date'</span>,        Zend_Date::<span style="color: #006600;">now</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>-&gt;<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span>Zend_Date::<span style="color: #006600;">DATE_LONG</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'image:photo'</span>, <span style="color: #0000ff;">$photoFilename</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">createDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$document</span> = <span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">retrieveDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'pdf'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
file_put_contents<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'document.pdf'</span>, <span style="color: #0000ff;">$document</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">deleteImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$photoFilename</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>The version of <em>Zend_Service_LiveDocx_MailMerge</em> that contains image merging will be released with the next Zend Framework release. For the time being, it is part of the <a href="http://www.phplivedocx.org/2009/12/03/migrated-to-zend-framework-standard-trunk/">Standard Trunk</a> and can be checked out via SVN.</p>
<p>You can find the above sample application in the following directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">/demos/Zend/Service/LiveDocx/MailMerge/conference-pass/</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2010/10/05/image-merging-with-livedocx/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating templates with OpenOffice.org</title>
		<link>http://www.phplivedocx.org/2009/09/20/creating-templates-with-openoffice-org/</link>
		<comments>http://www.phplivedocx.org/2009/09/20/creating-templates-with-openoffice-org/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 04:29:17 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=968</guid>
		<description><![CDATA[Lucas Mbiwe, over at the LiveDocx Blog, has just published a blog post that illustrates how to generate templates in OpenOffice.org (OOo). If you wish to create templates in OOo, please read this text: Creating templates using OpenOffice.org His tutorial is relevant to OOo 2.4, 3.0 and 3.1. I would like to draw special attention [...]]]></description>
			<content:encoded><![CDATA[<p><em>Lucas Mbiwe</em>, over at the <a href="http://blog.livedocx.com">LiveDocx Blog</a>, has just published a blog post that illustrates how to generate templates in OpenOffice.org (OOo). If you wish to create templates in OOo, please read this text:</p>
<ul>
<li><strong><a href="http://blog.livedocx.com/post/Creating-templates-using-OpenOfficeorg.aspx">Creating templates using OpenOffice.org</a></strong></li>
</ul>
<p>His tutorial is relevant to OOo 2.4, 3.0 and 3.1.</p>
<p>I would like to draw special attention to the last paragraph of his text.</p>
<p><img src="http://www.phplivedocx.org/wp-content/uploads/2009/09/ooo-31-template.png" width="430" height="414" /></p>
<p>Although the merge field names in the above template <em>appear</em> to be:</p>
<ul>
<li><em>LiveDocx.letter.recipient</em></li>
<li><em>LiveDocx.letter.sender</em></li>
</ul>
<p>i.e. with a period as path separator, they are in fact:</p>
<ul>
<li><em>LiveDocxÿletterÿrecipient</em></li>
<li><em>LiveDocxÿletterÿsender</em></li>
</ul>
<p>i.e. with the character &#160;<strong>ÿ</strong>&#160; as path separator.</p>
<p>When assigning data to the template, you must use the notation with &#160;<strong>ÿ</strong>&#160; and not a period. For example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php"><span style="color: #0000ff;">$mailMerge</span> = <span style="color: #000000; font-weight: bold;">new</span> Zend_Service_LiveDocx_MailMerge<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setUsername</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'myUsername'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">setPassword</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'myPassword'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setLocalTemplate</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'template.docx'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'LiveDocxÿletterÿrecipient'</span>, <span style="color: #ff0000;">'Sam Johnson'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'LiveDocxÿletterÿsender'</span>, <span style="color: #ff0000;">'Peter James'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">createDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$document</span> = <span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">retrieveDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'pdf'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
file_put_contents<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'document.pdf'</span>, <span style="color: #0000ff;">$document</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>The method <em>getFieldNames()</em> correctly returns the field names with &#160;<strong>ÿ</strong>&#160; as path separator.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/09/20/creating-templates-with-openoffice-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Template creation in TX Template Designer</title>
		<link>http://www.phplivedocx.org/2009/01/15/template-creation-in-tx-template-designer/</link>
		<comments>http://www.phplivedocx.org/2009/01/15/template-creation-in-tx-template-designer/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 05:38:03 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=284</guid>
		<description><![CDATA[Following my post yesterday about document creation in Microsoft Word, I would like to present another method. If you own a copy of TX Text Control .Net, you already have a very nifty template designer installed on your hard disk. It is called TX Template Designer and is part of the basic install package of [...]]]></description>
			<content:encoded><![CDATA[<p>Following my <a href="http://www.phplivedocx.org/2009/01/14/template-creation-in-microsoft-word-2003/">post</a> yesterday about document creation in Microsoft Word, I would like to present another method.</p>
<p>If you own a copy of <em>TX Text Control .Net</em>, you already have a very nifty template designer installed on your hard disk. It is called <em>TX Template Designer</em> and is part of the basic install package of the aforementioned software component.</p>
<p>To create a template in <em>TX Text Designer</em>, just follow these brief steps.</p>
<ol>
<li>Open the TX Template Designer. The original location is at: <em>C:Program FilesThe Imaging Source Europe GmbHTX Text Control 14.0.NETSamplesTX Template Designer</em>. An empty document will be opened automatically.</li>
<li>Insert a <em>MergeField</em> into the document by choosing <em>Insert</em> from the <em>Insert</em> main menu. Additionally, some sample text could be added to the test document.</li>
<li>Click on the inserted field to open the Mini Editor dialog. This dialog can be used to rapidly step through all fields to change the names or to open the properties dialog.
<p>    Type in the name of the field: &#8220;name&#8221;:</p>
<p>    <img src="/wp-content/uploads/2009/01/templates-tx-template-designer-01.gif" width="207" height="77" alt="" /></p>
</li>
<li>Select <em>Properties&#8230;</em> in the Mini Editor dialog or press F2 to open the appropriate properties dialog. This dialog can be used to change the format of the field. Additionally, some advanced options can be adjusted. Select the settings as shown in the screenshot below:
<p>    <img src="/wp-content/uploads/2009/01/templates-tx-template-designer-02.gif" width="341" height="252" alt="" /></p>
</li>
<li>Repeat step 2 and 3 to insert another field and name this field &#8220;company&#8221;. Additionally, you could change the text of both fields. The finished template should now look like this:
<p>    <img src="/wp-content/uploads/2009/01/templates-tx-template-designer-03.gif" width="293" height="144" alt="" /></p>
</li>
</ol>
<p>Consider the following PHP5 code, which can be used to populate the template created above. Assume that the template has been saved with the filename <em>template.docx</em>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php"><span style="color: #0000ff;">$mailMerge</span> = <span style="color: #000000; font-weight: bold;">new</span> Zend_Service_LiveDocx_MailMerge<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setUsername</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'myUsername'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">setPassword</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'myPassword'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setLocalTemplate</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'template.docx'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'name'</span>,    <span style="color: #ff0000;">'Henry Anderson'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'company'</span>, <span style="color: #ff0000;">'Flowers Direct 2000'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">createDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$document</span> = <span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">retrieveDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'pdf'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
file_put_contents<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'document.pdf'</span>, <span style="color: #0000ff;">$document</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>For a discussion on the logic of this source code, please see <a href="http://www.phplivedocx.org/2009/01/15/basic-phplivedocx-example/">this post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/15/template-creation-in-tx-template-designer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Template creation in Microsoft Word 2003</title>
		<link>http://www.phplivedocx.org/2009/01/14/template-creation-in-microsoft-word-2003/</link>
		<comments>http://www.phplivedocx.org/2009/01/14/template-creation-in-microsoft-word-2003/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 11:24:38 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=164</guid>
		<description><![CDATA[A core part of any phpLiveDocx project is the creation of a template file. Using Microsoft Word 2003, this takes only a matter of minutes: Open Microsoft Word 2003 to create a new document. Select Insert, Field&#8230; from the main menu to open the Field dialog box. Choose the MergeField from the Mail Merge category [...]]]></description>
			<content:encoded><![CDATA[<p>A core part of any phpLiveDocx project is the creation of a template file. Using Microsoft Word 2003, this takes only a matter of minutes:</p>
<ol>
<li>Open Microsoft Word 2003 to create a new document.
</li>
<li>Select <em>Insert</em>, <em>Field&#8230;</em> from the main menu to open the <em>Field</em> dialog box.
</li>
<li>Choose the <em>MergeField</em> from the <em>Mail Merge</em> category and specify a name for the new field: <em>name</em>.
</li>
<li>Specify the format and some field options as shown in the following screenshot:
<p>	<img src="/wp-content/uploads/2009/01/templates-msword-01.gif" width="445" height="326" alt="Template in Microsoft Word" /></p>
</li>
<li>Repeat step 2 and 3 to insert another field and name this field &#8220;company&#8221;. Additionally, you could change the text of both fields. The finished template should now look like this:
<p>	<img src="/wp-content/uploads/2009/01/templates-msword-02.gif" width="169" height="85" alt="Merge field in Microsoft Word" /></li>
</ol>
<p>Consider the following PHP5 code, which can be used to populate the template created above. Assume that the template has been saved with the filename <em>template.docx</em>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php"><span style="color: #0000ff;">$mailMerge</span> = <span style="color: #000000; font-weight: bold;">new</span> Zend_Service_LiveDocx_MailMerge<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setUsername</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'myUsername'</span><span style="color: #66cc66;">&#41;</span>
          -&gt;<span style="color: #006600;">setPassword</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'myPassword'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">setLocalTemplate</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'template.docx'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'NAME'</span>,    <span style="color: #ff0000;">'Mitchel'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">assign</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'company'</span>, <span style="color: #ff0000;">'Flowers Direct 2000'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">createDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$document</span> = <span style="color: #0000ff;">$mailMerge</span>-&gt;<span style="color: #006600;">retrieveDocument</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'pdf'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
file_put_contents<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'document.pdf'</span>, <span style="color: #0000ff;">$document</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>For a discussion on the logic of this source code, please see <a href="http://www.phplivedocx.org/2009/01/15/basic-phplivedocx-example/">this post</a>.</p>
<p>In future blog posts, we will be looking at how to create templates with <em>Open Office</em> and <a href="http://www.phplivedocx.org/2009/01/15/template-creation-in-tx-template-designer/">TX Template Designer</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/14/template-creation-in-microsoft-word-2003/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Template vs document &#8211; what&#8217;s the difference?</title>
		<link>http://www.phplivedocx.org/2009/01/13/template-vs-document-whats-the-difference/</link>
		<comments>http://www.phplivedocx.org/2009/01/13/template-vs-document-whats-the-difference/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 10:49:17 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Documents]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=151</guid>
		<description><![CDATA[The phpLiveDocx project and the backend service LiveDocx differentiate between the following terms: 1) template and 2) document. In order to fully understand the documentation and indeed the actual API, it is important that any programmer deploying phpLiveDocx understands the difference. Template The term template is used to refer to the input file, containing formatting [...]]]></description>
			<content:encoded><![CDATA[<p>The phpLiveDocx project and the backend service LiveDocx differentiate between the following terms: 1) <em>template</em> and 2) <em>document</em>. In order to fully understand the documentation and indeed the actual API, it is important that any programmer deploying phpLiveDocx understands the difference.</p>
<h3>Template</h3>
<p>The term <em>template</em> is used to refer to the <strong>input file</strong>, containing formatting and text fields. You can download an <a href="http://www.phplivedocx.org/wp-content/uploads/2009/01/license-agreement-template.docx">example template</a>, stored as a DOCX file.</p>
<h3>Document</h3>
<p>The term <em>document</em> is used to refer to the <strong>output file</strong> that contains the template file, populated with data &#8211; i.e. the finished document. You can download an <a href="http://www.phplivedocx.org/wp-content/uploads/2009/01/license-agreement-document.pdf">example document</a>, stored as a PDF file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/13/template-vs-document-whats-the-difference/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Supported file formats in phpLiveDocx</title>
		<link>http://www.phplivedocx.org/2009/01/12/supported-file-formats-in-phplivedocx/</link>
		<comments>http://www.phplivedocx.org/2009/01/12/supported-file-formats-in-phplivedocx/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 10:40:16 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=149</guid>
		<description><![CDATA[Using phpLiveDocx, it is possible to populate template files, containing text fields, with data from disparate data sources (such as XML files, databases etc). The resulting word processing document can be saved in any supported format. Supported template file formats (input) DOCX &#8211; Office Open XML Format DOC &#8211; Microsoft Word DOC Format RTF &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Using phpLiveDocx, it is possible to populate template files, containing text fields, with data from disparate data sources (such as XML files, databases etc).</p>
<p>The resulting word processing document can be saved in any supported format.</p>
<h3>Supported template file formats (input)</h3>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Office_Open_XML">DOCX</a> &#8211; Office Open XML Format</li>
<li><a href="http://en.wikipedia.org/wiki/DOC_(computing)">DOC</a> &#8211; Microsoft Word DOC Format</li>
<li><a href="http://en.wikipedia.org/wiki/Rich_Text_Format">RTF</a> &#8211; Rich Text Format</li>
<li><a href="http://www.textcontrol.com/">TXD</a> &#8211; TX Text Control Format</li>
</ul>
<h3>Supported document file formats (output)</h3>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Office_Open_XML">DOCX</a> &#8211; Office Open XML Format</li>
<li><a href="http://en.wikipedia.org/wiki/DOC_(computing)">DOC</a> &#8211; Microsoft Word DOC Format</li>
<li><a href="http://en.wikipedia.org/wiki/Xhtml">HTML</a> &#8211; XHTML 1.0 Transitional Format</li>
<li><a href="http://en.wikipedia.org/wiki/Rich_Text_Format">RTF</a> &#8211; Rich Text Format</li>
<li><a href="http://en.wikipedia.org/wiki/Portable_Document_Format">PDF</a> &#8211; Acrobat Portable Document Format</li>
<li><a href="http://www.textcontrol.com/">TXD</a> &#8211; TX Text Control Format</li>
<li><a href="http://en.wikipedia.org/wiki/Text_file">TXT</a> &#8211; ANSI Plain Text</li>
</ul>
<h3>Supported image file formats (output)</h3>
<ul>
<li><a href="http://en.wikipedia.org/wiki/BMP_file_format">BMP</a> &#8211; Bitmap Image Format</li>
<li><a href="http://en.wikipedia.org/wiki/GIF">GIF</a> &#8211; Graphics Interchange Format</li>
<li><a href="http://en.wikipedia.org/wiki/Jpg">JPG</a> &#8211; Joint Photographic Experts Group Format</li>
<li><a href="http://en.wikipedia.org/wiki/Portable_Network_Graphics">PNG</a> &#8211; Portable Network Graphics Format</li>
<li><a href="http://en.wikipedia.org/wiki/Tagged_Image_File_Format">TIFF</a> &#8211; Tagged Image File Format</li>
<li><a href="http://en.wikipedia.org/wiki/Windows_Metafile">WMF</a> &#8211; Windows Meta File Format</li>
</ul>
<p>This information is also available programmatically. This <a href="http://www.phplivedocx.org/2009/01/21/programmatically-getting-supported-file-formats/">post</a> illustrates how.</p>
<p>The phpLiveDocx project and the backend service LiveDocx differentiate between the terms <strong>template</strong> and <strong>document</strong>. For details, please see <a href="http://www.phplivedocx.org/2009/01/13/template-vs-document-whats-the-difference/">this post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/12/supported-file-formats-in-phplivedocx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

