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

General questions regarding the use of languages and encoding issues in Joomla! 1.0.x. Multi-lingual site solutions can be discussed in the child board. Translation discussions are now separate and can be found in the Working Groups Area.

Moderator: General Support Moderators

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Sat Jan 05, 2008 3:14 pm

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!

User avatar
dzed
Joomla! Guru
Joomla! Guru
Posts: 994
Joined: Sun Feb 18, 2007 6:40 pm
Location: Constantine, Algeria
Contact:

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

Post by dzed » Sat Jan 05, 2008 4:34 pm

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).
Saber Bousba - صابر بوصبع
Member of the Arabic [ar-DZ] Joomla Translation Team :  http://joomlacode.org/gf/project/ardz/

User avatar
dzed
Joomla! Guru
Joomla! Guru
Posts: 994
Joined: Sun Feb 18, 2007 6:40 pm
Location: Constantine, Algeria
Contact:

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

Post by dzed » Sat Jan 05, 2008 4:45 pm

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
Saber Bousba - صابر بوصبع
Member of the Arabic [ar-DZ] Joomla Translation Team :  http://joomlacode.org/gf/project/ardz/

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Sat Jan 05, 2008 4:56 pm

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...  :)
Last edited by emav on Sat Jan 05, 2008 5:25 pm, edited 1 time in total.

User avatar
dzed
Joomla! Guru
Joomla! Guru
Posts: 994
Joined: Sun Feb 18, 2007 6:40 pm
Location: Constantine, Algeria
Contact:

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

Post by dzed » Sat Jan 05, 2008 5:04 pm

ok emav
and thanks for your hard work
Saber Bousba - صابر بوصبع
Member of the Arabic [ar-DZ] Joomla Translation Team :  http://joomlacode.org/gf/project/ardz/

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Sun Jan 06, 2008 2:51 am

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.  :)
You do not have the required permissions to view the files attached to this post.

mtk
Joomla! Guru
Joomla! Guru
Posts: 856
Joined: Sat Nov 12, 2005 10:55 pm
Location: Israel
Contact:

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

Post by mtk » Sun Jan 06, 2008 2:59 am

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?
"In a world without walls and fences,
who needs Windows & Gates?"

http://www.smartmtk.com | http://www.lighthost.co.il/webhosting-for-joomla

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Sun Jan 06, 2008 3:06 am

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.

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Sun Jan 06, 2008 4:38 am

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.  :)
You do not have the required permissions to view the files attached to this post.

mtk
Joomla! Guru
Joomla! Guru
Posts: 856
Joined: Sat Nov 12, 2005 10:55 pm
Location: Israel
Contact:

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

Post by mtk » Sun Jan 06, 2008 5:04 am

I'll test & report back soon...
"In a world without walls and fences,
who needs Windows & Gates?"

http://www.smartmtk.com | http://www.lighthost.co.il/webhosting-for-joomla

User avatar
dzed
Joomla! Guru
Joomla! Guru
Posts: 994
Joined: Sun Feb 18, 2007 6:40 pm
Location: Constantine, Algeria
Contact:

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

Post by dzed » Sun Jan 06, 2008 12:01 pm

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
Last edited by dzed on Sun Jan 06, 2008 12:03 pm, edited 1 time in total.
Saber Bousba - صابر بوصبع
Member of the Arabic [ar-DZ] Joomla Translation Team :  http://joomlacode.org/gf/project/ardz/

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Sun Jan 06, 2008 1:14 pm

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.

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Sun Jan 06, 2008 1:17 pm

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.

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Sun Jan 06, 2008 3:11 pm

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.

mtk
Joomla! Guru
Joomla! Guru
Posts: 856
Joined: Sat Nov 12, 2005 10:55 pm
Location: Israel
Contact:

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

Post by mtk » Mon Jan 07, 2008 10:54 am

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...
"In a world without walls and fences,
who needs Windows & Gates?"

http://www.smartmtk.com | http://www.lighthost.co.il/webhosting-for-joomla

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Mon Jan 07, 2008 3:43 pm

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.

mtk
Joomla! Guru
Joomla! Guru
Posts: 856
Joined: Sat Nov 12, 2005 10:55 pm
Location: Israel
Contact:

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

Post by mtk » Mon Jan 07, 2008 3:52 pm

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...
"In a world without walls and fences,
who needs Windows & Gates?"

http://www.smartmtk.com | http://www.lighthost.co.il/webhosting-for-joomla

User avatar
emav
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Nov 03, 2006 7:39 pm
Location: Thessaloniki, Greece

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

Post by emav » Mon Jan 07, 2008 5:29 pm

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...  ;)

User avatar
dzed
Joomla! Guru
Joomla! Guru
Posts: 994
Joined: Sun Feb 18, 2007 6:40 pm
Location: Constantine, Algeria
Contact:

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

Post by dzed » Mon Jan 07, 2008 7:50 pm

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
Saber Bousba - صابر بوصبع
Member of the Arabic [ar-DZ] Joomla Translation Team :  http://joomlacode.org/gf/project/ardz/

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18855
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

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

Post by infograf768 » Sun Mar 09, 2008 8:58 am

FYI, we are now moving to tcpdf 2.6 for to be released Joomla 1.5.2.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

jimlad
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 24, 2008 11:02 pm

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

Post by jimlad » Sat Mar 29, 2008 12:22 pm

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/

mdf092
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Dec 06, 2006 11:03 am

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

Post by mdf092 » Mon Oct 06, 2008 8:33 am

hi
this is my 1st post
i use TCPDF in farsi but characters are separated

why?

thanks

SudaDreamS
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Sat Dec 08, 2007 10:39 am

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

Post by SudaDreamS » Wed May 27, 2009 7:05 pm

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?

kaosteam
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Sat Jul 11, 2009 3:14 pm
Location: antalya
Contact:

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

Post by kaosteam » Mon Jul 20, 2009 1:28 pm

PDF is a big problem and this was very helpful for me. Thanks!

DeCex
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Sep 10, 2008 5:08 pm

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

Post by DeCex » Mon Aug 03, 2009 10:46 am

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.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18855
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

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

Post by infograf768 » Mon Aug 03, 2009 11:34 am

Folks,
we do not support 1.0.x now, better move to 1.5... :pop
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

by rallier
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Oct 31, 2009 6:07 pm
Contact:

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

Post by by rallier » Sat Oct 31, 2009 6:55 pm

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.
Joomla Extensions Clubs| http://www.stylemo.net |
JoomLa Fun | emo

Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65


Locked

Return to “Language - 1.0.x”