<?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; Press</title>
	<atom:link href="http://www.phplivedocx.org/category/press/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phplivedocx.org</link>
	<description>Zend_Service_LiveDocx</description>
	<lastBuildDate>Tue, 08 Jun 2010 09:11:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHPHatesMe.com publishes LiveDocx article</title>
		<link>http://www.phplivedocx.org/2009/10/28/phphatesme-com-publishes-livedocx-article/</link>
		<comments>http://www.phplivedocx.org/2009/10/28/phphatesme-com-publishes-livedocx-article/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 06:23:35 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Press]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=1050</guid>
		<description><![CDATA[Please note: This blog post is for our German-speaking readers only. The leading German language PHP web site, PHPHatesMe.com has just published an article in German about Zend_Service_LiveDocx_MailMerge. The text introduces the component library, explains the benefits of its template-based approach and finally offers some sample applications, which illustrate the work-flow of applications, deploying LiveDocx [...]]]></description>
			<content:encoded><![CDATA[<p style="padding: 5px; background-color: #EFEFEF;"><strong>Please note</strong>: This blog post is for our German-speaking readers only.</p>
<p>The leading German language PHP web site, <a href="http://www.phphatesme.com">PHPHatesMe.com</a> has just published an <a href="http://www.phphatesme.com/blog/webentwicklung/pdf-erzeugung-mit-dem-zend-framework/">article</a> in German about <em>Zend_Service_LiveDocx_MailMerge</em>.</p>
<p>The text introduces the component library, explains the benefits of its template-based approach and finally offers some sample applications, which illustrate the work-flow of applications, deploying LiveDocx for document generation.</p>
<p>Click on the following screenshot to read the full article.</p>
<p style="text-align:center;padding:15px 0px;"><a href="http://www.phphatesme.com/blog/webentwicklung/pdf-erzeugung-mit-dem-zend-framework/"><img src="http://www.phplivedocx.org/wp-content/uploads/2009/10/phphatesme-capture.png" width="467" height="390" alt="PHPHatesMe.com: PDF-Erzeugung mit dem Zend Framework" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/10/28/phphatesme-com-publishes-livedocx-article/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate PDF, DOCX and RTF files with PHP</title>
		<link>http://www.phplivedocx.org/2009/02/03/generate-pdf-docx-doc-and-rtf-files-with-php/</link>
		<comments>http://www.phplivedocx.org/2009/02/03/generate-pdf-docx-doc-and-rtf-files-with-php/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 15:12:11 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Press]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=519</guid>
		<description><![CDATA[I am delighted to announce that we have just published the following press release for phpLiveDocx: Bremen, Germany (February 03, 2009) &#8211; Traditionally, the generation of professional looking PDF files with PHP has been a tricky programming task: A number of PHP libraries are available, which allow developers to either convert HTML documents to PDF [...]]]></description>
			<content:encoded><![CDATA[<p>I am delighted to announce that we have just published the following press release for phpLiveDocx:</p>
<blockquote>
<p>Bremen, Germany (February 03, 2009) &#8211; Traditionally, the generation of professional looking PDF files with PHP has been a tricky programming task: A number of PHP libraries are available, which allow developers to either convert HTML documents to PDF or programmatically generate PDFs from scratch. Business documents created using the former approach are limited by the capabilities of HTML, while it is extremely tedious to get the layout of documents just right, for those, which are generated using the latter approach.</p>
<p>phpLiveDocx offers a solution to both these problems: Templates, which are created in a WYSIWYG environment (such as a standard word processor) are populated with structured data from PHP. The resulting document can be saved as a PDF, DOCX, DOC or RTF file. The concept is the same as with mail-merge.</p>
<p>The benefits to an enterprise are numerous:</p>
<ul>
<li>phpLiveDocx separates template and programming logic, thus a graphic designer can produce the template, while a developer can populate it. Additionally, changes to the layout of a template can be made without any changes to the programming logic.</li>
</ul>
<ul>
<li>Using phpLiveDocx, populating a template is simply a matter of assigning a value to a text field. When PDF templates are to be populated using existing solutions, the x and y coordinates of the position at which text should inserted must be specified. It is very time-consuming to calculate these coordinates and in some cases, not possible at all.</li>
</ul>
<ul>
<li>phpLiveDocx is the PHP5 implementation of the SOAP web service LiveDocx. As such, it is not necessary that an administrator install any further software on the server, in order to use phpLiveDocx. The complex word processing and mail-merge processes take place on the backend platform. This not only lowers maintenance costs, but also reduces the hardware requirements of the client web server.</li>
</ul>
<p>phpLiveDocx has been authored to fit the architecture of the Zend Framework and follows its extreme simplicity philosophy.</p>
<p>To learn more about phpLiveDocx, read the documentation and download a number of runnable sample applications, please take a look at <a href="/articles/brief-introduction-to-phplivedocx/">this article</a>.</p>
</blockquote>
<p>If you would like to try out phpLiveDocx for yourself, please <a href="/downloads/">download</a> the libraries and sample applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/02/03/generate-pdf-docx-doc-and-rtf-files-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Try out phpLiveDocx today!</title>
		<link>http://www.phplivedocx.org/2009/01/15/try-out-phplivedocx-today/</link>
		<comments>http://www.phplivedocx.org/2009/01/15/try-out-phplivedocx-today/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 16:16:04 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Press]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/2009/01/15/try-out-phplivedocx-today/</guid>
		<description><![CDATA[Please note: This post is part of a five post series. See introduction, part 1, part 2, part 3 and part 4. To set up an evaluation account for LiveDocx or discuss your individual requirements, please take a look at the official web site. phpLiveDocx is supported by an active community of developers, who are [...]]]></description>
			<content:encoded><![CDATA[<p style="padding: 5px; background-color: #EFEFEF;"><strong>Please note</strong>: This post is part of a five post series. See <a href="/2009/01/15/another-approach-to-ralf-eggerts-pdf-mit-zend/">introduction</a>, <a href="/2009/01/15/document-generation-with-zend_pdf/">part 1</a>, <a href="/2009/01/15/introducing-a-more-elegant-solution/">part 2</a>, <a href="/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/">part 3</a> and <a href="/2009/01/15/try-out-phplivedocx-today/">part 4</a>.</p>
<p>To set up an evaluation account for LiveDocx or discuss your individual requirements, please take a look at the official web site. phpLiveDocx is supported by an active community of developers, who are willing to address your specific needs.</p>
<ul>
<li><a href="http://www.livedocx.com/">LiveDocx</a> &#8211; official web site.</li>
<li><a href="/downloads/">phpLiveDocx</a> &#8211; community implementation in PHP5.</li>
<li><a href="http://www.textcontrol.com/">TX Text Control</a> &#8211; technology that powers LiveDocx.</li>
</ul>
<p>Please feel free to <a href="/contact/">contact me</a>, if you would like to talk about any aspect of phpLiveDocx.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/15/try-out-phplivedocx-today/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Advantages of phpLiveDocx over Zend_Pdf</title>
		<link>http://www.phplivedocx.org/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/</link>
		<comments>http://www.phplivedocx.org/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 16:15:36 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Press]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/</guid>
		<description><![CDATA[Please note: This post is part of a five post series. See introduction, part 1, part 2, part 3 and part 4. The advantages of the phpLiveDocx method of document creation over the Zend_Pdf method are numerous: phpLiveDocx separates template and programming logic. A graphical designer can produce the template, while a developer can take [...]]]></description>
			<content:encoded><![CDATA[<p style="padding: 5px; background-color: #EFEFEF;"><strong>Please note</strong>: This post is part of a five post series. See <a href="/2009/01/15/another-approach-to-ralf-eggerts-pdf-mit-zend/">introduction</a>, <a href="/2009/01/15/document-generation-with-zend_pdf/">part 1</a>, <a href="/2009/01/15/introducing-a-more-elegant-solution/">part 2</a>, <a href="/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/">part 3</a> and <a href="/2009/01/15/try-out-phplivedocx-today/">part 4</a>.</p>
<p>The advantages of the phpLiveDocx method of document creation over the Zend_Pdf method are numerous:</p>
<ul>
<li>phpLiveDocx separates template and programming logic. A graphical designer can produce the template, while a developer can take care of populating it. Similarly, changes to the layout of a template can be made without any changes to the programming logic.</li>
</ul>
<ul>
<li>Unlike with Zend_Pdf, in which a template must be painstakingly programmed, phpLiveDocx allows templates to be created in a true WYSIWYG environment, using <em>Microsoft Word</em>, <em>Open Office</em> or<em> TX Template Designer</em>.</li>
</ul>
<ul>
<li>When populating PDF templates with Zend_Pdf, the x and y coordinates of the position at which text should written must be specified. It is very time-consuming to calculate these coordinates and in some cases, not possible at all. Zend_Pdf offers no concept of a text field. Using phpLiveDocx, populating a template is simply a matter of assigning a value to a text field.</li>
</ul>
<ul>
<li>Using the Zend Framework in the current incarnation (v1.7.1), there is no way to create word processing documents in DOCX, DOC or RTF formats. phpLiveDocx makes these file formats available with one single parameter. Generating a DOCX file, for example, is exactly the same procedure as for a PDF.</li>
</ul>
<ul>
<li>The backend service to phpLiveDocx &#8211; LiveDocx &#8211; is authored by the manufacturer of <a href="http://www.textcontrol.com/">TX Text Control</a>, a company, which has around 20 years experience in the production of quality word processing components. Customers of LiveDocx are entitled to free telephone and e-mail support.</li>
</ul>
<div style="padding: 5px; background-color: #EFEFEF; margin-bottom: 10px;">
<p>Continue to the next part of this five part series:</p>
<ul>
<li><a href="/2009/01/15/try-out-phplivedocx-today/">Try phpLiveDocx out today!</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing a more elegant solution</title>
		<link>http://www.phplivedocx.org/2009/01/15/introducing-a-more-elegant-solution/</link>
		<comments>http://www.phplivedocx.org/2009/01/15/introducing-a-more-elegant-solution/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 16:14:44 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Press]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=193</guid>
		<description><![CDATA[Please note: This post is part of a five post series. See introduction, part 1, part 2, part 3 and part 4. The manufacturer of the celebrated word processing component TX Text Control has recently brought to market a document creation platform, which provides a very elegant solution to the programmatic creation of well-formatted word [...]]]></description>
			<content:encoded><![CDATA[<p style="padding: 5px; background-color: #EFEFEF;"><strong>Please note</strong>: This post is part of a five post series. See <a href="/2009/01/15/another-approach-to-ralf-eggerts-pdf-mit-zend/">introduction</a>, <a href="/2009/01/15/document-generation-with-zend_pdf/">part 1</a>, <a href="/2009/01/15/introducing-a-more-elegant-solution/">part 2</a>, <a href="/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/">part 3</a> and <a href="/2009/01/15/try-out-phplivedocx-today/">part 4</a>.</p>
<p>The manufacturer of the celebrated word processing component <a href="http://www.textcontrol.com/">TX Text Control</a> has recently brought to market a document creation platform, which provides a very elegant solution to the programmatic creation of well-formatted word processing documents in PDF, DOCX, DOC and RTF formats. The platform, which is SOAP based and hence completely independent of any specific programming language, is called <a href="http://www.livedocx.com/">LiveDocx</a>.</p>
<p>The PHP community has put together a PHP5 implementation, called phpLiveDocx, which is released under the New BSD License and can be downloaded from the <a href="/downloads/">downloads section</a> of this blog.</p>
<p>The idea of phpLiveDocx is really simple: Indeed, it embodies the <em>extreme simplicity</em> philosophy of the Zend Framework, for which the component has been designed. Using phpLiveDocx, a graphical designer can create a template in <em>Microsoft Word</em>, <em>Open Office</em> or a specialized tool, called <em>TX Template Designer</em>. In the template, s/he can embed any number of text fields, into which, in a second step, data can be populated using phpLiveDocx. The resulting word processing document can be saved as a PDF, DOCX, DOC or RTF file.</p>
<p>Consider the following diagram &#8211; it explains the flow of data in a phpLiveDocx application:</p>
<p style="text-align:center"><img src="/wp-content/uploads/2009/01/dia_basic_function.gif" width="550" height="300"></p>
<p>The green shape to the left symbolizes a template. The dark blue shape directly beneath symbolizes arbitrary data (in this case, textual data from an XML file). The cloud in the center of the diagram is the LiveDocx service. The resulting document (in this case a very short letter) is symbolized by the light blue shape to the right.</p>
<p>Or, expressed as PHP5 code:</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
</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;">'firstname'</span>, <span style="color: #ff0000;">'Peter'</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;">'user'</span>, <span style="color: #ff0000;">'Jacky Hewitt'</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>;</pre></td></tr></table></div>

<p>The resulting word processing document, as a PDF file, is stored in the variable <em>$document</em>. Simply by passing <em>docx</em>, <em>doc</em> or <em>rtf</em>, it would have been equally possible to retrieve the document in another supported format.</p>
<p>Although the above example could have been implemented using Zend_Pdf &#8211; given that the developer has sufficient patience and time to get the positioning of the inserted text just right and that the output document is a PDF file &#8211; there are certain types of document formatting, which make the deployment of the Zend Framework component extremely tedious.</p>
<p>Consider the following template file, which is part of a software license agreement. Using this template, a software manufacturer can generate a license agreement for a specific software and licensee. The text fields are represented as <span style="color: rgb(56, 118, 29);">%textFieldName%</span>.</p>
<blockquote><h3>Agreement for <span style="color: rgb(56, 118, 29);">%software%</span> between <span style="color: rgb(56, 118, 29);">%company%</span> and <span style="color: rgb(56, 118, 29);">%licensee%</span></h3>
<p><strong>Subject of agreement</strong><br />
The subject of this agreement is the software <span style="color: rgb(56, 118, 29);">%software%</span>, the operating manuals, online help files and all other accompanying material. It will be referred to henceforth as <span style="color: rgb(56, 118, 29);">%software%</span>.</p>
<p><strong>Grant of license</strong><br />
<span style="color: rgb(56, 118, 29);">%company%</span> grants <span style="color: rgb(56, 118, 29);">%licensee%</span> a non-exclusive, non-transferable, personal and worldwide license to use one copy of <span style="color: rgb(56, 118, 29);">%software%</span> in the development of an end-user application, as described in section 3 (below). This license is for a single developer and not for an entire company. If additional programmers wish to use <span style="color: rgb(56, 118, 29);">%software%</span>, additional copies must be licensed.</p>
</blockquote>
<p>In this template, there is the additional problem that it is impossible to know in advance exactly at which coordinates text should be inserted. The position of the text fields depends upon the length of the content in the previous text field. In the title of the agreement, for example, the value for <span style="color: rgb(56, 118, 29);">%company%</span> must be inserted at two entirely different coordinates, if <span style="color: rgb(56, 118, 29);">%software%</span> has the value <span style="color: rgb(56, 118, 29);">Ace Downloader</span> or <span style="color: rgb(56, 118, 29);">Magical Compression Suite Deluxe Edition Pro</span>. The resulting documents would look as follows:<br />
<blockquote><h3>Agreement for <span style="color: rgb(56, 118, 29);">Ace Downloader</span> between <span style="color: rgb(56, 118, 29);">MegaSoft Corp</span> and <span style="color: rgb(56, 118, 29);">Peter Paul</span></h3>
</blockquote>
<p>and</p>
<blockquote><h3>Agreement for <span style="color: rgb(56, 118, 29);">Magical Compress Suite Deluxe Edition Pro</span> between <span style="color: rgb(56, 118, 29);">MegaSoft Corp</span> and <span style="color: rgb(56, 118, 29);">Peter Paul</span></h3>
</blockquote>
<p>As the name of the first software has only 14 characters, <span style="color: rgb(56, 118, 29);">%company%</span> appears on the first line, whereas in the second example, <span style="color: rgb(56, 118, 29);">%software%</span> has 44 characters, hence pushing the second and third text field onto the next line.</p>
<p>Using phpLiveDocx, the developer does not have to worry about the plethora of possible layout and formatting options in a word processing document. All s/he needs to know is the names of the text fields. phpLiveDocx has been designed from the ground up to make the creation of word processing documents a pain-free process, thus increasing the productivity of the developer.</p>
<div style="padding: 5px; background-color: #EFEFEF; margin-bottom: 10px:">
<p>Continue to the next part of this five part series:</p>
<ul>
<li><a href="/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/">Advantages of phpLiveDocx over Zend_Pdf</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/15/introducing-a-more-elegant-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Document generation with Zend_Pdf</title>
		<link>http://www.phplivedocx.org/2009/01/15/document-generation-with-zend_pdf/</link>
		<comments>http://www.phplivedocx.org/2009/01/15/document-generation-with-zend_pdf/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 16:14:03 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Press]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=192</guid>
		<description><![CDATA[Please note: This post is part of a five post series. See introduction, part 1, part 2, part 3 and part 4. Towards the middle of the Ralf&#8217;s article in PHP Magazin, in a section which talks about how to populate PDF templates, the author expresses some concern about how tricky it is to get [...]]]></description>
			<content:encoded><![CDATA[<p style="padding: 5px; background-color: #EFEFEF;"><strong>Please note</strong>: This post is part of a five post series. See <a href="/2009/01/15/another-approach-to-ralf-eggerts-pdf-mit-zend/">introduction</a>, <a href="/2009/01/15/document-generation-with-zend_pdf/">part 1</a>, <a href="/2009/01/15/introducing-a-more-elegant-solution/">part 2</a>, <a href="/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/">part 3</a> and <a href="/2009/01/15/try-out-phplivedocx-today/">part 4</a>.</p>
<p>Towards the middle of the Ralf&#8217;s article in <a href="http://it-republik.de/php/artikel/Einfuehrung-in-die-Zend_Pdf-Komponente-des-Zend-Frameworks-2086.html">PHP Magazin</a>, in a section which talks about how to populate PDF templates, the author expresses some concern about how tricky it is to get the positioning of pseudo text fields just right in a PDF template (an English translation of this passage is directly after the quotation):</p>
<blockquote><p>In der Regel werden die PDF-Vorlagen verwendet, um am bestimmten Stellen im Dokument variable Inhalte einzufügen. Da Zend_Pdf intern mit Punkten (1/72 eines Inches) arbeitet, kann die Platzierung von Texten mit PDF-Vorlagen aus anderem Quellen durchaus problematisch werden.</p>
<p>Ich habe diese einmal mit deiner PDF-Vorlage umsetzen müssen, die die zu füllenden Textfelder nicht nach Punkten, sondern eher wahllos auf der Seite verteilt hatte. Es kann schon bei einer Vorlage, die nur aus einer DIN-A4-Seite besteht, aber 20 bis 30 Felder hat, die es zu befühlen gilt, ein paar Stunden dauern, bis man alle Texte einigermaßen gut platziert hat. Der Begriff &#8220;Pixelschubser&#8221; bekommt da eine ganz neue Bedeutung.</p></blockquote>
<p>The above quotation can be translated into English as follows:</p>
<blockquote><p>Typically, PDF templates are used to insert content into documents at pre-defined positions. As Zend_Pdf internally uses points (1/72 of an inch), it can be tricky to get the positioning of text just right in PDF templates originating from sources other than the Zend Framework.</p>
<p>Once I had the task of programmatically populating a PDF template in which text fields were not specified in points, but were rather haphazardly placed all over the page. It can take several hours until you get the positioning of text just right in an A4 document with 20 to 30 text fields. The term &#8220;pixel-pimping&#8221; takes on a completely new meaning.</p></blockquote>
<p>To illustrate how the population of PDF templates works with the Zend Framework, Ralf presents an example, which is available on the cover DVD of the magazine or can be <a href="http://it-republik.de/zonen/magazine/ausgaben/psfile/source_file/90/eggert_zen4919940dc91a3.zip">downloaded</a>. The logic is as follows:</p>
<ol>
<li>Load a PDF file with Zend_Pdf.</li>
<li>Loop through each piece of text, which should be inserted into the template and specify its x and y coordinates, using the <em>drawText()</em> method. For example:

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #0000ff;">$page</span>-&gt;<span style="color: #006600;">drawText</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Henry'</span>, <span style="color: #cc66cc;">200</span>, <span style="color: #cc66cc;">620</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

</li>
<li>Render and save the PDF file.</li>
</ol>
<p>The problem here, is that with Zend_Pdf, there is no concept of a text field. For example, it is not possible to specify that a placeholder is called <em>firstName</em> and then programmatically set the value of <em>firstName</em> to say <em>Henry</em>. Instead, it is necessary to specify that at position 200, 620 <em>Henry</em> should be written. It is therefore, very understandable when Ralf writes: <em>The term &#8220;pixel-pimping&#8221; takes on a completely new meaning.</em></p>
<p>For each an every piece of text, which should be inserted into a document, exact coordinates must be specified &#8211; a very time consuming, nerve-wracking and consequently error prone task.</p>
<p>Furthermore, to be able to use Zend_Pdf at all, the exact coordinates at which text should be inserted must be known <em>in advance</em>. For example, should the graphical design department change the design of say an invoice, then a programmer must update his/her code in the PDF generation process, re-specifying coordinates as applicable. This makes Zend_Pdf a very brittle solution: One small change in the PDF template and the generated PDF document is broken.</p>
<p>In a similar vein, many legacy word processing documents are not stored as PDF files at all. In a typical office environment, the vast majority of documents are stored in DOC and more currently, DOCX formats. These documents often contain text fields (or merge fields, as they are called by Microsoft), into which data can be injected. In the current incarnation of the Zend Framework (v1.7.1) there is no provision whatsoever to load these file formats, let alone populate them with data from disparate data sources.</p>
<div style="padding: 5px; background-color: #EFEFEF; margin-bottom: 10px:">
<p>Continue to the next part of this five part series:</p>
<ul>
<li><a href="/2009/01/15/introducing-a-more-elegant-solution/">Introducing a more elegant solution</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/15/document-generation-with-zend_pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another approach to Ralf Eggert&#8217;s &#8220;PDF mit Zend&#8221;</title>
		<link>http://www.phplivedocx.org/2009/01/15/another-approach-to-ralf-eggerts-pdf-mit-zend/</link>
		<comments>http://www.phplivedocx.org/2009/01/15/another-approach-to-ralf-eggerts-pdf-mit-zend/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 15:44:36 +0000</pubDate>
		<dc:creator>Jonathan Maron</dc:creator>
				<category><![CDATA[Press]]></category>

		<guid isPermaLink="false">http://www.phplivedocx.org/?p=187</guid>
		<description><![CDATA[Please note: This post is part of a five post series. See introduction, part 1, part 2, part 3 and part 4. In the December 2008 &#8211; January 2009 issue of the German language magazine PHP Magazin, a five page article by Ralf Eggert was published, in which he discusses the Zend Framework component Zend_Pdf. [...]]]></description>
			<content:encoded><![CDATA[<p style="padding: 5px; background-color: #EFEFEF;"><strong>Please note</strong>: This post is part of a five post series. See <a href="/2009/01/15/another-approach-to-ralf-eggerts-pdf-mit-zend/">introduction</a>, <a href="/2009/01/15/document-generation-with-zend_pdf/">part 1</a>, <a href="/2009/01/15/introducing-a-more-elegant-solution/">part 2</a>, <a href="/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/">part 3</a> and <a href="/2009/01/15/try-out-phplivedocx-today/">part 4</a>.</p>
<p><a href="http://it-republik.de/php/"><img style="float:right; padding-left: 10px" src="/wp-content/uploads/2009/01/php-magazin-dec-2008-jan-2009.jpg" width="130" height="183"></a></p>
<p>In the <em>December 2008 &#8211; January 2009</em> issue of the German language magazine <a href="http://it-republik.de/php/artikel/Einfuehrung-in-die-Zend_Pdf-Komponente-des-Zend-Frameworks-2086.html">PHP Magazin</a>, a five page article by <a href="http://www.ralfeggert.de/2008/11/13/php-magazin-109-ist-erschienen-mit-meinem-zend_pdf-artikel/">Ralf Eggert</a> was published, in which he discusses the <a href="http://www.zendframework.com/">Zend Framework</a> component <a href="http://framework.zend.com/manual/en/zend.pdf.html">Zend_Pdf</a>.</p>
<p>In the following four blog posts, I would like to present an alternative and considerably easier way of document generation with the Zend Framework.</p>
<ol>
<li><a href="/2009/01/15/document-generation-with-zend_pdf/">Document generation with Zend_Pdf</a></li>
<li><a href="/2009/01/15/introducing-a-more-elegant-solution/">Introducing a more elegant solution</a></li>
<li><a href="/2009/01/15/advantages-of-phplivedocx-over-zend_pdf/">Advantages of phpLiveDocx over Zend_Pdf</a></li>
<li><a href="/2009/01/15/try-out-phplivedocx-today/">Try phpLiveDocx out today!</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.phplivedocx.org/2009/01/15/another-approach-to-ralf-eggerts-pdf-mit-zend/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
