Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PDF and UTF-8 charsets


Guest

Recommended Posts

I`m testing this contribution http://addons.oscommerce.com/info/5321, it`s for PDF invoices. If all will be good i`ll add it to my shop!

 

 

But i came up with a problem for my language (Latvian - ē ū ī ā š ķ ļ etc.) special charters. So i have searched forum for answers, but got only questions and no good solution for it!

 

This contribution is using FPDF as i understood it`s dose not support UTF-8, so i have made my research and find that UFPDF is the answer on my question, but the main problem is that as i`m not a programmer, but i understand how this works, can someone help me to solve this, how to replace FPDF with UPDF.

 

 

Can someone give me a clue or point to right direction or best way supply with already fixed solution!

 

Thanks!

Link to comment
Share on other sites

I don't have this contribution installed, so I can not say much. Taking a quick look, I found in file pdfinvoice.php following line

	$pdf->MultiCell(70, 3.3, tep_html_entity_decode(tep_address_format($order->customer['format_id'], $order->customer, '', '', "\n")),0,'L');

 

like for everything that is getting printed.

 

I can not tell you how to solve this, but this is causing the error

Link to comment
Share on other sites

I don't have this contribution installed, so I can not say much. Taking a quick look, I found in file pdfinvoice.php following line

	$pdf->MultiCell(70, 3.3, tep_html_entity_decode(tep_address_format($order->customer['format_id'], $order->customer, '', '', "\n")),0,'L');

 

like for everything that is getting printed.

 

I can not tell you how to solve this, but this is causing the error

 

 

i`ll try to figure out why it`s so but i have i clue! :)

Link to comment
Share on other sites

if i get that i will! ;)

 

p.s. we need to share our knowledge! :)

 

 

I have trying to combinate FPDF and UFPDF, but can`t get it work, maybe someone hve done it?

Link to comment
Share on other sites

I have trying to combinate FPDF and UFPDF, but can`t get it work, maybe someone hve done it?

 

Can you post exactly what you was trying to do and what the results are? Will be easier for somebody else to jump in

Link to comment
Share on other sites

  • 1 month later...

After two sleepless nights (and a ton of smoked cigarettes - just kidding) I finally came up with a solution.

 

I had installed PDF invoice and Pslip with FPDF. I downloaded TCPDF. I copied tcpdf.php in fpdf directory and renamed it in fpdf.php. I copied all the .php files in tcpdf directory to fpdf dir. I also copied the config and the fonts directory to fpdf directory. Then I changed the pdfinvoice.php (around line 125)

 

class PDF extends FPDF

in

class PDF extends TCPDF

 

then I Setting up a Verdana font for usage with TCPDF (described in the Utils folder) [if you need help with changing the fonts, just ask]. upload it to the fonts directory.

 

in tcpdf.php (or now renamed fpdf.php) I replaced all the source codes courier with verdana. and that's it...now I have Croatian special characters [šđč枊ĐČĆŽ]

Link to comment
Share on other sites

After two sleepless nights (and a ton of smoked cigarettes - just kidding) I finally came up with a solution.

 

I had installed PDF invoice and Pslip with FPDF. I downloaded TCPDF. I copied tcpdf.php in fpdf directory and renamed it in fpdf.php. I copied all the .php files in tcpdf directory to fpdf dir. I also copied the config and the fonts directory to fpdf directory. Then I changed the pdfinvoice.php (around line 125)

 

class PDF extends FPDF

in

class PDF extends TCPDF

 

then I Setting up a Verdana font for usage with TCPDF (described in the Utils folder) [if you need help with changing the fonts, just ask]. upload it to the fonts directory.

 

in tcpdf.php (or now renamed fpdf.php) I replaced all the source codes courier with verdana. and that's it...now I have Croatian special characters [šđč枊ĐČĆŽ]

 

 

This is really fantastic!!

 

Can send me thous fonts u used - Verdana?

Link to comment
Share on other sites

  • 1 month later...

look in PM's

 

 

I have found time for testing your theory, but i have an error when i try make an PDF

 

this is the error:

 

TCPDF ERROR: Could not include font definition file: arial

 

But cant find any arial in new fpdf.php

Link to comment
Share on other sites

I have found time for testing your theory, but i have an error when i try make an PDF

 

this is the error:

 

TCPDF ERROR: Could not include font definition file: arial

 

But cant find any arial in new fpdf.php

 

 

Stuid me! :P

 

Got it solved, i did not have any arial fonts on my server, so i made them and then it all worked perfectly!

 

p.s. for thous who are asking about the last command of making font - php -q makefont.php myfont.ttf myfont.ufm

 

This is need to be executed from Telnet client such as Putty! just copy your files to the server and have fun! (This took a while for me to understand!)

 

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...