Page 3 of 3

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sat Jan 05, 2008 3:14 pm
by emav
Thanks for the detailed report, dzed.
dzed wrote:- Language *en-GB* end *fr-FR*
As released, the hack would work fine with western language texts and middle eastern quotations or vice versa. It's a problem, I know, but this has already been fixed. The new version I'm working on will identify text independently from Joomla! and align each paragraph accordingly.
dzed wrote:2 - the alignement of line made by the editor e.g. Aligne centre, Aligne left, etc... not work
We haven't come to this point yet... Hopefully, it will work in time. :)
dzed wrote:3 - the variation of the line e.g. bold, bold oblique, etc... not work only Underline work see pic
TCPDF only supports underline.
dzed wrote:4 - all latin Language is aligne auto to the right of pdf page and arabic to left
This has already been fixed in the upcoming version but further testing is needed.
dzed wrote:info about file generated and size

- Andalus = 68 Ko
- trado = 112 Ko
- DejaVuSans = 646 Ko
Good info. Thanks!

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sat Jan 05, 2008 4:34 pm
by dzed
emac
thanks for reply and i have a goood news for you and all community  ;D

TCPDF 2.0.000 for both PH4 and PHP5 were released!

This version introduces RTL (Right-To-Left) languages support, document encryption, GIF support and several new features and bug fixes.

TCPDF is an Open Source PHP class for generating PDF files on-the-fly without requiring external extensions.
TCPDF is used by a large number of php projects such as AIOCP, Drupal, Joomla, Xoops, TCExam, etc.

Main features:
- supports all ISO page formats; 
- supports UTF-8 Unicode and Right-To-Left languages; 
- supports document encryption; 
- includes methods to publish some xhtml code, supporting the following elements: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small; 
- includes a method to print various barcode formats using an improved version of "Generic Barcode Render Class" by Karim Mribti (http://www.mribti.com/barcode/) (require GD library: http://www.boutell.com/gd/
- supports TrueTypeUnicode, TrueType, Type1 and encoding; 
- supports custom page formats, margins and units of measure; 
- includes methods for page header and footer management; 
- supports automatic page break; 
- supports automatic page numbering; 
- supports automatic line break and text justification; 
- supports JPEG, PNG anf GIF images; 
- supports colors; 
- supports links; 
- support page compression (require zlib extension: http://www.gzip.org/zlib/); 
- the source code is full documented in PhpDocumentor Style (http://www.phpdoc.org).

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sat Jan 05, 2008 4:45 pm
by dzed
TEST N° 1 for v2.0

Proper alignment of text on the right side of the page NOT WORK
Text is properly displayed from top to bottom and from right to left  NOT WORK
Arabic letters are properly joined (thanks to ArGlyphs)  NOT WORK


CAN YOU ADD YOUR HACK TO THIS VERSION

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sat Jan 05, 2008 4:56 pm
by emav
I see my name mentioned at the top of the document:
Efthimios Mavrogeorgiadis (emavro@yahoo.com) for suggestions on RTL language support.
I contacted Nicola a few days ago informing him about PHPBiDi and its integration with TCPDF to provide support for RTL languages. Unfortunately, I haven't heard from him since.

I can see that he included all my changes to tcpdf.php, he added some improvements, but he left out the most crucial function (txt2RTL) and the whole library (PHPBiDi). However, you can't produce RTL text without support from Unicode's bidirectional algorithm which PHPBiDi, freebidi and other libraries implement.

I'll contact him again and try to explain what has to be done. Until then, keep testing...  :)

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sat Jan 05, 2008 5:04 pm
by dzed
ok emav
and thanks for your hard work

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 2:51 am
by emav
Here's the latest version of TCPDF+PHPBiDi much more improved than the previous release, i.e. all the goodies mentioned above plus:
  • Cleaned up code, which means fewer interventions in TCPDF's code and complete separation from PHPBiDi.
  • The whole text is divided and parsed in paragraphs. This allows for better results when bidirectionality comes into play.
  • Arabic ligature Lam with Alef (isolated and final forms) is now supported.
  • Links are now displayed properly.
  • Mixed language paragraphs are now displayed properly.
Just extract the attached file in TCPDF's folder and keep on sending those bug reports.  :)

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 2:59 am
by mtk
Hi,
thanks, but the files you provided are for TCPDF 1.53.0.TC034_PHP4 (see code of tcpdf.php)...
are there any TCPDF 2.0 compatible?

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 3:06 am
by emav
I haven't moved to TCPDF 2.0 yet. I'll need to examine what other changes have been made to the file before I dare move in that direction.

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 4:38 am
by emav
Well, there weren't that many changes after all. The things that changed have to do with encryption and image handling. Nothing that would affect text manipulation. So, here goes... TCPDF2.0.000 + PHPBiDi.  :)

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 5:04 am
by mtk
I'll test & report back soon...

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 12:01 pm
by dzed
thanks

i tested your new hack

1-problem with Interligne
Spacing between lines of text is not default (1.0 or 1.15) its (2.5 or 3.0)
It affects articles with the Arabic language and arabic+latin, the articles with the latin language only is ok

2 - the font size is very very smal, the articles with the latin language only is ok

i will make some others test with arabic and hebrew language

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 1:14 pm
by emav
dzed wrote: 1-problem with Interligne
Spacing between lines of text is not default (1.0 or 1.15) its (2.5 or 3.0)
It affects articles with the Arabic language and arabic+latin, the articles with the latin language only is ok
That's not the hack's problem. It's due to new code introduced in TCPDF2. Erase lines 4342-4343 of the hacked file or avoid using in your html code.
dzed wrote:2 - the font size is very very smal, the articles with the latin language only is ok
Again, the hack does not affect font size in any way but, in any case, I haven't noticed any difference on my system where I test with DejaVuSans.

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 1:17 pm
by emav
emav wrote:That's not the hack's problem. It's due to new code introduced in TCPDF2. Erase lines 4342-4343 of the hacked file or avoid using in your html code.
I'll have to take this back. I just tested with the plain file and the problem seems to disappear. Let me have a look again and I'll come back with a solution.

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Jan 06, 2008 3:11 pm
by emav
No, it wasn't the hack after all but I'll have to add two more lines to the list: 4492-4493. All in all, 4 lines are added after each paragraph if it is followed by . So,
is the way to go if you want to avoid getting all those blank spaces.

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Jan 07, 2008 10:54 am
by mtk
emav wrote: No, it wasn't the hack after all but I'll have to add two more lines to the list: 4492-4493. All in all, 4 lines are added after each paragraph if it is followed by . So,
is the way to go if you want to avoid getting all those blank spaces.
is not only the correct HTML of doing spaces, but Paragraphs are the right way of writing (texts).
when dealing with web pages, they are first thought for web display, then for PDF Export.

I don't think the avoiding the use of is a common thing to ask...

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Jan 07, 2008 3:43 pm
by emav
My hack with TCPDF goes as far as to provide support for RTL languages. Whether you prefer to use or further modify TCPDF is up to you to decide.

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Jan 07, 2008 3:52 pm
by mtk
should be understood as a paragraph, not an RTL or LTR entity.
specially if it contains no styling.

text in it should be align to default and margin/padding should be generate.
exactly like the HTML does...




I'm not complaining against your contribution at all, I'm just saying that you cannot expect users not to use .


Keep up the good job, I'll report with my findings regarding RTL later on...

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Jan 07, 2008 5:29 pm
by emav
mtk wrote:I'm not complaining against your contribution at all, I'm just saying that you cannot expect users not to use .
I didn't take your previous message as a complaint. I only tried to explain why I can't help you further with this problem. I pointed at the lines that cause the problem. You may or may not want to remove them but I can't do that myself. That would mean distributing a different version of TCPDF than the one created by Nicola Asuni. Integration with Joomla!, PHPBiDi and support for RTL languages is as far as I can go.

Now, as far as hacking happily away at my own installation of Joomla! and TCPDF is concerned, well, that's another matter...  ;)

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Jan 07, 2008 7:50 pm
by dzed
emav

i am back to use your hack for TCPDF v1.53, the original v2.0 with support for RTL not work
if you use in the future with all extensions updated for J1.5 its real problem, can you find other solution and i am here also to make test and help you if you need my help

thanks

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sun Mar 09, 2008 8:58 am
by infograf768
FYI, we are now moving to tcpdf 2.6 for to be released Joomla 1.5.2.

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sat Mar 29, 2008 12:22 pm
by jimlad
http://forum.joomla.org/viewtopic.php?f=430&t=278117

describes a bug related to the pdf functionality in 1.5.2

[#10323] Wrong parameter count for class_exists() http://joomlacode.org/gf/search/

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Oct 06, 2008 8:33 am
by mdf092
hi
this is my 1st post
i use TCPDF in farsi but characters are separated

why?

thanks

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Wed May 27, 2009 7:05 pm
by SudaDreamS
Hi all,

i did wt has been explained .. i get
TCPDF error: Could not include font definition file

i'm using arabic language

what can i do next?

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Jul 20, 2009 1:28 pm
by kaosteam
PDF is a big problem and this was very helpful for me. Thanks!

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Aug 03, 2009 10:46 am
by DeCex
uh, how do i bind this to the "pdf" button when click? I have installed like example above, but when click on the pdf button, it open a new blank window and hangs.

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Mon Aug 03, 2009 11:34 am
by infograf768
Folks,
we do not support 1.0.x now, better move to 1.5... :pop

Re: [Hack] Unicode PDF problem solved on Joomla! 1.0.x

Posted: Sat Oct 31, 2009 6:55 pm
by by rallier
http://forum.joomla.org/viewtopic.php?p ... 0#p1795450

Why not supoort 1.0.x ;?
ı using 1.0 version.

/i have little english.If i do a mistake,Sorry.