<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Convert a spool file to PDF using PHP on i5/OS</title>
	<atom:link href="http://www.zimuel.it/blog/?feed=rss2&#038;p=360" rel="self" type="application/rss+xml" />
	<link>http://www.zimuel.it/blog/?p=360</link>
	<description>Computer programming in PHP for business and passion</description>
	<lastBuildDate>Fri, 03 Sep 2010 06:30:42 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Enrico Zimuel</title>
		<link>http://www.zimuel.it/blog/?p=360&#038;cpage=1#comment-240</link>
		<dc:creator>Enrico Zimuel</dc:creator>
		<pubDate>Fri, 03 Sep 2010 06:30:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.zimuel.it/blog/?p=360#comment-240</guid>
		<description>Hi David,
unfortunately the i5_spool can manage only strings, no images. If you need to convert complex spool file to PDF I suggest to use the CVT2PDF (http://www.code400.com/cvt2pdf.php) and call it with the i5 Toolkit from PHP.</description>
		<content:encoded><![CDATA[<p>Hi David,<br />
unfortunately the i5_spool can manage only strings, no images. If you need to convert complex spool file to PDF I suggest to use the CVT2PDF (<a href="http://www.code400.com/cvt2pdf.php" rel="nofollow">http://www.code400.com/cvt2pdf.php</a>) and call it with the i5 Toolkit from PHP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Porter</title>
		<link>http://www.zimuel.it/blog/?p=360&#038;cpage=1#comment-239</link>
		<dc:creator>David Porter</dc:creator>
		<pubDate>Wed, 01 Sep 2010 17:06:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.zimuel.it/blog/?p=360#comment-239</guid>
		<description>Zimuel,

Thanks for the Spool Class and information on using the i5 Toolkit for strong i5/OS interactions.

I have a question: why does the i5_spool_get_data function only return a string, and being a string, why does it not return any of the formatting data associated with a print file such as boxes, simple lines or image overlays?

I would love to use the toolkit to convert spool data to PDF but I need all of the spool data, not just a long string of unformatted text.

Does that make sense?</description>
		<content:encoded><![CDATA[<p>Zimuel,</p>
<p>Thanks for the Spool Class and information on using the i5 Toolkit for strong i5/OS interactions.</p>
<p>I have a question: why does the i5_spool_get_data function only return a string, and being a string, why does it not return any of the formatting data associated with a print file such as boxes, simple lines or image overlays?</p>
<p>I would love to use the toolkit to convert spool data to PDF but I need all of the spool data, not just a long string of unformatted text.</p>
<p>Does that make sense?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrico Zimuel</title>
		<link>http://www.zimuel.it/blog/?p=360&#038;cpage=1#comment-106</link>
		<dc:creator>Enrico Zimuel</dc:creator>
		<pubDate>Tue, 16 Feb 2010 15:38:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.zimuel.it/blog/?p=360#comment-106</guid>
		<description>Hi Alberto, i found that this was a bug of your ZF version. In the new version of ZF this issue has been solved with the management of AIX (i5/OS) environments.
In /Zend/Pdf/Resource/Font/Simple.php in the new ZF version there is this patch:

 public function encodeString($string, $charEncoding)
    {
        if (PHP_OS == &#039;AIX&#039;) {
            return $string; // returning here b/c AIX doesnt know what CP1252 is
        }
        return iconv($charEncoding, &#039;CP1252//IGNORE&#039;, $string);
    }

I suggest you to upgrade your version of ZF with the last one.
Regarding the issue of the new PDF page in the i5Spool class I just fixed the problem. I updated the class in the post, thanks!</description>
		<content:encoded><![CDATA[<p>Hi Alberto, i found that this was a bug of your ZF version. In the new version of ZF this issue has been solved with the management of AIX (i5/OS) environments.<br />
In /Zend/Pdf/Resource/Font/Simple.php in the new ZF version there is this patch:</p>
<p> public function encodeString($string, $charEncoding)<br />
    {<br />
        if (PHP_OS == &#8216;AIX&#8217;) {<br />
            return $string; // returning here b/c AIX doesnt know what CP1252 is<br />
        }<br />
        return iconv($charEncoding, &#8216;CP1252//IGNORE&#8217;, $string);<br />
    }</p>
<p>I suggest you to upgrade your version of ZF with the last one.<br />
Regarding the issue of the new PDF page in the i5Spool class I just fixed the problem. I updated the class in the post, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alberto Ernestini</title>
		<link>http://www.zimuel.it/blog/?p=360&#038;cpage=1#comment-104</link>
		<dc:creator>Alberto Ernestini</dc:creator>
		<pubDate>Tue, 16 Feb 2010 15:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.zimuel.it/blog/?p=360#comment-104</guid>
		<description>Almost solved!!
There was some problems on the Iseries side.
A Codepage font problem reported as &#039; Wrong Charset conversion from utf-8 to CP1252//IGNORE is not allowed&#039;.


For this i had to modify the Font/Simple.php in this way :

/Zend/Pdf/Resource/Font/Simple.php

line 259, replace :

return iconv($charEncoding, &#039;CP1252//IGNORE&#039;, $string);

with

return $string;


and line 273, replace :

return iconv(&#039;CP1252&#039;, $charEncoding, $string);

with

return $string;

(taken from a Zend Forum post of 	Mon, 04 August 2008)

and also the other error was because of  line 111 on i5spool.php under toPdf function

$page-&gt;setFont($conf_pdf[&#039;font&#039;],$conf_pdf[&#039;font-size&#039;]);

changing it  with this :
	$page-&gt;setFont(Zend_Pdf_Font::fontWithName($conf_pdf[&#039;font&#039;]),(int)$conf_pdf[&#039;font-size&#039;]);
solved the font problem.

there is also a extra addition on the i5spool.php, at the new page i had to add this line after line 123
					$page-&gt;setFont(Zend_Pdf_Font::fontWithName($conf_pdf[&#039;font&#039;]),(int)$conf_pdf[&#039;font-size&#039;]);
this for set the font also on the new page.
Now the code works well , except for the breakpage but i think i can fix it :-)
Thanks a lot!
Ciao
Alberto</description>
		<content:encoded><![CDATA[<p>Almost solved!!<br />
There was some problems on the Iseries side.<br />
A Codepage font problem reported as &#8216; Wrong Charset conversion from utf-8 to CP1252//IGNORE is not allowed&#8217;.</p>
<p>For this i had to modify the Font/Simple.php in this way :</p>
<p>/Zend/Pdf/Resource/Font/Simple.php</p>
<p>line 259, replace :</p>
<p>return iconv($charEncoding, &#8216;CP1252//IGNORE&#8217;, $string);</p>
<p>with</p>
<p>return $string;</p>
<p>and line 273, replace :</p>
<p>return iconv(&#8217;CP1252&#8242;, $charEncoding, $string);</p>
<p>with</p>
<p>return $string;</p>
<p>(taken from a Zend Forum post of 	Mon, 04 August 2008)</p>
<p>and also the other error was because of  line 111 on i5spool.php under toPdf function</p>
<p>$page-&gt;setFont($conf_pdf['font'],$conf_pdf['font-size']);</p>
<p>changing it  with this :<br />
	$page-&gt;setFont(Zend_Pdf_Font::fontWithName($conf_pdf['font']),(int)$conf_pdf['font-size']);<br />
solved the font problem.</p>
<p>there is also a extra addition on the i5spool.php, at the new page i had to add this line after line 123<br />
					$page-&gt;setFont(Zend_Pdf_Font::fontWithName($conf_pdf['font']),(int)$conf_pdf['font-size']);<br />
this for set the font also on the new page.<br />
Now the code works well , except for the breakpage but i think i can fix it <img src='http://www.zimuel.it/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
Thanks a lot!<br />
Ciao<br />
Alberto</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrico Zimuel</title>
		<link>http://www.zimuel.it/blog/?p=360&#038;cpage=1#comment-105</link>
		<dc:creator>Enrico Zimuel</dc:creator>
		<pubDate>Tue, 16 Feb 2010 15:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.zimuel.it/blog/?p=360#comment-105</guid>
		<description>Hi Alberto, did you tried to install the last ZF version? I guess this problem comes out using an old version of ZF. I tried the example in the post using ZF 1.9.6 on i5/OS and i didn&#039;t found your error.</description>
		<content:encoded><![CDATA[<p>Hi Alberto, did you tried to install the last ZF version? I guess this problem comes out using an old version of ZF. I tried the example in the post using ZF 1.9.6 on i5/OS and i didn&#8217;t found your error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alberto Ernestini</title>
		<link>http://www.zimuel.it/blog/?p=360&#038;cpage=1#comment-103</link>
		<dc:creator>Alberto Ernestini</dc:creator>
		<pubDate>Mon, 15 Feb 2010 09:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.zimuel.it/blog/?p=360#comment-103</guid>
		<description>Hi , thanks for your prompt answer!
This is the error :
Catchable fatal error: Argument 1 passed to Zend_Pdf_Page::setFont() must be an instance of Zend_Pdf_Resource_Font, string given, called in /usr/local/Zend/5250/demos/emulation/i5Spool.php on line 111 and defined in /usr/local/Zend/ZendFramework/library/Zend/Pdf/Page.php on line 586

and this is what i am having on my Iseries 515 :
1ZCORE5  *BASE   5001    Zend Core for IBM i5/OS (2.6.1)       
1ZCORE5  1       5002    Zend Platform for IBM i5/OS (3.6.1  ) 


The Zend FW version is 1.6.0.

Thanks!
Ciao.
Alberto.</description>
		<content:encoded><![CDATA[<p>Hi , thanks for your prompt answer!<br />
This is the error :<br />
Catchable fatal error: Argument 1 passed to Zend_Pdf_Page::setFont() must be an instance of Zend_Pdf_Resource_Font, string given, called in /usr/local/Zend/5250/demos/emulation/i5Spool.php on line 111 and defined in /usr/local/Zend/ZendFramework/library/Zend/Pdf/Page.php on line 586</p>
<p>and this is what i am having on my Iseries 515 :<br />
1ZCORE5  *BASE   5001    Zend Core for IBM i5/OS (2.6.1)<br />
1ZCORE5  1       5002    Zend Platform for IBM i5/OS (3.6.1  ) </p>
<p>The Zend FW version is 1.6.0.</p>
<p>Thanks!<br />
Ciao.<br />
Alberto.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrico Zimuel</title>
		<link>http://www.zimuel.it/blog/?p=360&#038;cpage=1#comment-102</link>
		<dc:creator>Enrico Zimuel</dc:creator>
		<pubDate>Sat, 13 Feb 2010 17:23:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.zimuel.it/blog/?p=360#comment-102</guid>
		<description>Hi Alberto,
What&#039;s the error message that you got? Which version of ZF are you using?
In the i5Spool class you can use the function getList($user[,$num]) to get all the data of the user&#039;s spool files (the $num is an optional parameter to get only the first $num spool file).</description>
		<content:encoded><![CDATA[<p>Hi Alberto,<br />
What&#8217;s the error message that you got? Which version of ZF are you using?<br />
In the i5Spool class you can use the function getList($user[,$num]) to get all the data of the user&#8217;s spool files (the $num is an optional parameter to get only the first $num spool file).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alberto Ernestini</title>
		<link>http://www.zimuel.it/blog/?p=360&#038;cpage=1#comment-101</link>
		<dc:creator>Alberto Ernestini</dc:creator>
		<pubDate>Fri, 12 Feb 2010 22:21:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.zimuel.it/blog/?p=360#comment-101</guid>
		<description>Your article sound very interesting. As a Iseries specialist from too many years i&#039;ve tried to set it up on a test system, but i may need better PHP experience :-)
By example the i5spool asks also for a &#039;JOBNR&#039;  parameter and i wasn&#039;t able to set the correct font. i still get a error.

There is anything missing?
Thanks a lot.
Ciao.
Alberto.</description>
		<content:encoded><![CDATA[<p>Your article sound very interesting. As a Iseries specialist from too many years i&#8217;ve tried to set it up on a test system, but i may need better PHP experience <img src='http://www.zimuel.it/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
By example the i5spool asks also for a &#8216;JOBNR&#8217;  parameter and i wasn&#8217;t able to set the correct font. i still get a error.</p>
<p>There is anything missing?<br />
Thanks a lot.<br />
Ciao.<br />
Alberto.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
