<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Arabic RTL PDF Reports]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=8332</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8332&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Arabic RTL PDF Reports.]]></description>
		<lastBuildDate>Sun, 18 Aug 2019 14:30:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35732#p35732</link>
			<description><![CDATA[<p>Tested the fix and its OK.</p>]]></description>
			<author><![CDATA[null@example.com (rafat)]]></author>
			<pubDate>Sun, 18 Aug 2019 14:30:29 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35732#p35732</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35716#p35716</link>
			<description><![CDATA[<p><a href="https://github.com/FrontAccountingERP/FA/commit/3547961d9be53526e5a10bb1890416477a42304a">Fixed by @joe in repo</a></p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 18 Aug 2019 05:52:15 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35716#p35716</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35684#p35684</link>
			<description><![CDATA[<p>Glad you got it sorted, not sure if this is bug or as designed; it does seem a little incomplete that rtl just defaults all Textwrap alignments to right align though, I&#039;ll add it to <a href="http://mantis.frontaccounting.com/view.php?id=4987">mantis</a></p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Fri, 16 Aug 2019 14:30:03 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35684#p35684</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35683#p35683</link>
			<description><![CDATA[<p>And this is rep108</p>]]></description>
			<author><![CDATA[null@example.com (rafat)]]></author>
			<pubDate>Fri, 16 Aug 2019 12:21:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35683#p35683</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35682#p35682</link>
			<description><![CDATA[<p>Hi,</p><p>Tested reports and seem all OK for me at least.. here are some samples of rep107 and rep108</p>]]></description>
			<author><![CDATA[null@example.com (rafat)]]></author>
			<pubDate>Fri, 16 Aug 2019 12:18:11 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35682#p35682</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35680#p35680</link>
			<description><![CDATA[<p>@poncho1234</p><p>Thanks for your guidance.. much appreciated. What worked for me is to comment the else statement at the end..I dont know what is it for. The rest I did not touch ..even the C in header2.inc stayed the same .. Changing it to L, R also works as expected.</p><div class="codebox"><pre><code>if (!$this-&gt;rtl)
        {
            if ($align == &#039;right&#039;)
                $align = &#039;R&#039;;
            elseif ($align == &#039;left&#039;)
                $align = &#039;L&#039;;
            elseif ($align == &#039;center&#039;)
                $align = &#039;C&#039;;
            elseif ($align == &#039;justify&#039;)
                $align = &#039;J&#039;;
        }
        // else
        //    $align = &#039;R&#039;;</code></pre></div><p>I dont know if this is a permanent&nbsp; solution or it might affect other things.. I tested with different reports and looks fine to me.<br />Statement Report has a minor issue . I will look into it.</p>]]></description>
			<author><![CDATA[null@example.com (rafat)]]></author>
			<pubDate>Fri, 16 Aug 2019 01:58:48 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35680#p35680</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35679#p35679</link>
			<description><![CDATA[<p>@rafat, your not touching tcpdf core, your editing \reporting\includes\class.pdf.inc</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Thu, 15 Aug 2019 17:00:05 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35679#p35679</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35678#p35678</link>
			<description><![CDATA[<p>@poncho1234</p><p>Give me some time to experiment this... as we are touching tcpdf core .. which (supposedly) is very stable and is working OK for all. </p><p>I will come back to you soon.</p><p>Thx.</p>]]></description>
			<author><![CDATA[null@example.com (rafat)]]></author>
			<pubDate>Thu, 15 Aug 2019 16:28:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35678#p35678</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35677#p35677</link>
			<description><![CDATA[<p>1. Are you sure you only have one copy of header2.php(Check in the company folder)</p><br /><br /><p>2. Tracing the Textwrap function back to getCellCode:-</p><p>File: \reporting\includes\tcpdf.php<br /></p><div class="codebox"><pre><code>2993:                 if ($align == &#039;L&#039;) {
2994:                     if ($this-&gt;rtl) {
2995:                         $dx = $w - $width - $this-&gt;cMargin;
2996:                     } else {
2997:                         $dx = $this-&gt;cMargin;
2998:                     }
2999:                 } elseif ($align == &#039;R&#039;) {
3000:                     if ($this-&gt;rtl) {
3001:                         $dx = $this-&gt;cMargin;
3002:                     } else {
3003:                         $dx = $w - $width - $this-&gt;cMargin;
3004:                     }
3005:                 } elseif ($align == &#039;C&#039;) {
3006:                     $dx = ($w - $width) / 2;
3007:                 } elseif ($align == &#039;J&#039;) {
3008:                     if ($this-&gt;rtl) {
3009:                         $dx = $w - $width - $this-&gt;cMargin;
3010:                     } else {
3011:                         $dx = $this-&gt;cMargin;
3012:                     }</code></pre></div><p>Option &#039;C&#039; does not have a if ($this-&gt;rtl) statement so &#039;C&#039; should have no difference in RTL or LTR</p><p>So 2a. Logout, Delete all cache in company folder, delete browser cache(Pref change browser) log back in. </p><p>2.b In function Textwrap&nbsp; a function addTextWrap is called, part of function below:-</p><p>File: \reporting\includes\class.pdf.inc<br /></p><div class="codebox"><pre><code>294:     function addTextWrap($xb, $yb, $w, $h, $txt, $align=&#039;left&#039;, $border=0, $fill=0, $link = NULL, $stretch = 1, $spacebreak=false)
295:     {
296:         $ret = &quot;&quot;;
297:         if (!$this-&gt;rtl)
298:         {
299:             if ($align == &#039;right&#039;)
300:                 $align = &#039;R&#039;;
301:             elseif ($align == &#039;left&#039;)
302:                 $align = &#039;L&#039;;
303:             elseif ($align == &#039;center&#039;)
304:                 $align = &#039;C&#039;;
305:             elseif ($align == &#039;justify&#039;)
306:                 $align = &#039;J&#039;;
307:         }
308:         else
309:             $align = &#039;R&#039;;</code></pre></div><p>this seems to be expecting the $align variable to be either &#039;right&#039;, &#039;left&#039;, &#039;justify&#039;, &#039;center&#039;; not R, L, J, or C.</p><p>So in header2.php try this:-</p><div class="codebox"><pre><code>$this-&gt;TextWrap($col, $this-&gt;row, $width, $info_header, &#039;center&#039;);</code></pre></div><p>Delete cache etc</p><p>Post back results please</p><p>Edit it also states that if rtl everything will be R so try changing the else part to this:-<br /></p><div class="codebox"><pre><code>297:         if (!$this-&gt;rtl)
298:         {
299:             if ($align == &#039;right&#039;)
300:                 $align = &#039;R&#039;;
301:             elseif ($align == &#039;left&#039;)
302:                 $align = &#039;L&#039;;
303:             elseif ($align == &#039;center&#039;)
304:                 $align = &#039;C&#039;;
305:             elseif ($align == &#039;justify&#039;)
306:                 $align = &#039;J&#039;;
307:         }
308:         else
            {
                 if ($align == &#039;right&#039;)
                     $align = &#039;R&#039;;// This may need to be &#039;L&#039;
                 elseif ($align == &#039;left&#039;)
                     $align = &#039;R&#039;;
                 elseif ($align == &#039;center&#039;)
                     $align = &#039;C&#039;;
                 elseif ($align == &#039;justify&#039;)
                     $align = &#039;J&#039;;
             }</code></pre></div><p>You may need to change <br />if ($align == &#039;right&#039;)<br />&nbsp; &nbsp; $align = &#039;R&#039;;<br />to<br />if ($align == &#039;right&#039;)<br />&nbsp; &nbsp; $align = &#039;L&#039;;</p><p>Note you will need to use:-<br /></p><div class="codebox"><pre><code>$this-&gt;TextWrap($col, $this-&gt;row, $width, $info_header, &#039;center&#039;);</code></pre></div><p>in header2.php for this to work</p><p>Also this will affect all <strong>ten</strong> of the print documents please check all of them: Please pay special attention to Report 108 (Print statements) As Textwrap is called an additional two times.</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Thu, 15 Aug 2019 15:02:08 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35677#p35677</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35675#p35675</link>
			<description><![CDATA[<p>The Arabic file.</p><p>Please look at the footer as well..</p>]]></description>
			<author><![CDATA[null@example.com (rafat)]]></author>
			<pubDate>Thu, 15 Aug 2019 09:38:06 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35675#p35675</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35674#p35674</link>
			<description><![CDATA[<p>Thanks guys,</p><p>@boxygen I tried with the new reporting folder but no luck. Same issue.<br />@poncho1234 I am attaching the same report (rep107) both when English is selected and when Arabic is selected. I highlighted the difference in yellow.</p>]]></description>
			<author><![CDATA[null@example.com (rafat)]]></author>
			<pubDate>Thu, 15 Aug 2019 09:37:02 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35674#p35674</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35673#p35673</link>
			<description><![CDATA[<p>@rafat you can try on this new reporting folder</p><p><a href="https://frontaccounting.com/punbb/viewtopic.php?pid=35223#p35223">https://frontaccounting.com/punbb/viewt … 223#p35223</a></p>]]></description>
			<author><![CDATA[null@example.com (boxygen)]]></author>
			<pubDate>Thu, 15 Aug 2019 02:29:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35673#p35673</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35669#p35669</link>
			<description><![CDATA[<p>@Rafat, Look at a LTR report in the mirror, take a pic; then compare it with your RTL report, highlight differences and post both pics</p><br /><br /><p>Note that the FA version of TCPDF is quite dated, there may well be RTL bugs in previous versions. Maybe try the latest version - <a href="https://github.com/tecnickcom/TCPDF"> TCPDF github</a> tcpdf.php, but this may give you more problems than are resolved. But if it does fix the problem at least you know there is a fix - then compare old and new versions. Remember to rename the original tcpdf.php version.</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Wed, 14 Aug 2019 16:14:58 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35669#p35669</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35667#p35667</link>
			<description><![CDATA[<p>Not all the report in LTR is left aligned.&nbsp; The middle part (Between the Company Name and email ..etc and the Bill of Material Details) Is what is called Auxiliary document information is centered as described&nbsp; in header2.inc</p><div class="codebox"><pre><code>     // Auxiliary document information
        $col = $this-&gt;leftMargin;
        foreach($aux_info as $info_header =&gt; $info_content)
        {

            $this-&gt;row = $iline2 - $this-&gt;lineHeight - 1;
            $this-&gt;TextWrap($col, $this-&gt;row, $width, $info_header, &#039;C&#039;);
            $this-&gt;row = $iline3 - $this-&gt;lineHeight - 1;
            $this-&gt;TextWrap($col, $this-&gt;row, $width, $info_content, &#039;C&#039;);
            $col += $width;
        }</code></pre></div><p>The TextWrap(.....$info_header, &#039;C&#039;) means centered. If I change the &#039;C&#039; to &#039;L&#039; it goes left or &#039;R&#039; it goes right.. only if the language is NOT RTL. If the language is English then it behaves according to the choice I made. Arabic always right aligned.</p><p>There must be a catch somewhere ..</p>]]></description>
			<author><![CDATA[null@example.com (rafat)]]></author>
			<pubDate>Wed, 14 Aug 2019 13:28:14 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35667#p35667</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arabic RTL PDF Reports]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35666#p35666</link>
			<description><![CDATA[<p>Documents in LTR are not centered, the Company name, email etc is aligned left, it is a mirror image of&nbsp; the pdf you have attached.</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Wed, 14 Aug 2019 11:34:37 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35666#p35666</guid>
		</item>
	</channel>
</rss>
