PDF does not show correct encoding


(vixus) #1

when i export reports in pdf format, some words dont show correctly as it

i use an arabic translation for piwik

for example : the countries names in arabic shows like ??? instead of arabic letters

i think the error is in the pdf class file

screenshots:

[attachment=1611:piwikpdf1.gif]

[attachment=1621:piwikpdf2.gif]

edit: the screen shots are token from the pdf file


(Matthieu Aubry) #2

Hi
Im curious where you got the arabic translation? It isn’t part of the official list: http://piwik.org/translations/

If you translated it, please contribute it! it would be great. But does Piwik work in RTL?

For the font issue, try replacing in this file: http://dev.piwik.org/trac/browser/trunk/pl…enderer.php#L18

Line 18, replace helvetica by arialunicid0

does it work now?


(vixus) #3

hi mat

i wrote the arabic translation for few months ago , maybe with piwik 0.5.3 or before, but i did’nt complete it correctly (some phrases was unclear to me)

so, i want to help piwik community and share it but i think you will refuse it

but now i will translate it all and send to your email as noticed in translations page .

piwik works on rtl as i see , i didn’t config html template to run right to left (direction)
it runs as it . the only difference is the language

now after update to 0.8 some words get flipped when view stats in vertical bar graph and piechart
i mean for example the country name changed to (states united) while the correct is united states

that only problem to now

let’s back to pdf now

i changed the font name as you noticed but there is a error

Warning: include(/home/vixus/public_html/vixus/piwik/libs/tcpdf/fonts/uni2cid_aj16.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/vixus/public_html/vixus/piwik/libs/tcpdf/fonts/arialunicid0.php on line 1767

and the last line is:


TCPDF ERROR: Some data has already been output to browser, can't send PDF file

i can’t understand this error, beacause the exists already and the scripts says not. !


(vixus) #4

i tried to use almohanad font which i founded in fonts directory but i get this error

TCPDF ERROR: Font file not found: almohanad.ctg.z

in other script i founded the pdf class with arabic support and i founded almohanad font in its files

so, i uploaded the files almohanad.ctg.z and almohanad.z but not almohanad.php and it works !

but also there is a problem

some arabic words are not completed or maybe hided under the border of file (something like margin maybe)

and some English words are incorrect (example: word visits displayed without | in i letter, only dot diplayed)

to understand please view the attachment

and sorry for my bad english

[attachment=1641:piwikpdffont.gif]

i hope you add tahoma or arial font to work in pdf (if it works)

thanks


(Matthieu Aubry) #5

Hi thanks for the report. I created a ticket at: http://dev.piwik.org/trac/ticket/1537

can you please try something?

download latest TCPDF library in piwik/libs/tcpdf.

Then try again my previous suggestion to use arial unicode font:

For the font issue, try replacing in this file: http://dev.piwik.org/trac/browser/trunk/pl…enderer.php#L18

Line 18, replace helvetica by arialunicid0

maybe this would fix it, but probably not. Thanks for trying