Part of the EllisLab Network
   
1 of 2
1
DOMPDF utf-8 support
Posted: 20 January 2008 10:40 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  01-20-2008

Hello community.

First I must say I like codeigniter very muchos.

I’m trying to create pdf documents from html, and I found this article very interesting. My problem is that I need to create utf-8 pdf files.

At dompdf homepage I found this: Unicode support when using PDFLib, courtesy Jeremy Buchman (licensed version only—PDFLib Lite will NOT work)

I’m using commercial pdflib version with licence number inserted into config file.
I don’t know what I’m doing wrong but I just can’t make it works with utf-8.

I used instructions to create amf files from ttf and script worked fine but effective only in copying files, it didn’t convert anything.

Anyone have some atf file supporting utf, please if you could send it to my mail for testing purposes. Final application will run on linux but I must be sure utf works fine with dompdf.


Anyone succeed in that at windows?

Profile
 
 
Posted: 21 January 2008 08:58 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  4716
Joined  03-23-2006

I had some trouble with this with Bamboo.  Essentially, I needed to make sure there was an explicit meta tag stating that the content in my view (the one I was using for domPDF as utf-8.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
title><?php echo $page_title;?></title>
<
meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 
... 
 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
MojoMotor - The Publishing Engine That Does Less!

Profile
MSG
 
 
Posted: 21 January 2008 01:49 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  124
Joined  04-16-2007

It works perfectly fine than? With that commercial licence?

See, I would really get my PDFs containing Æ, Ø and Å to work, without words collapsing into each other.. even if I have to pay for it..

 Signature 

EVERY TIME YOU ASK ABOUT CODEIGNITER 2.0… PHIL STURGEON KILLS A KITTEN

Profile
 
 
Posted: 21 January 2008 01:52 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  4716
Joined  03-23-2006

Are you saving them into a database first tobben?  I could be that your database is changing the charset.  Try just straight html first.

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
MojoMotor - The Publishing Engine That Does Less!

Profile
MSG
 
 
Posted: 21 January 2008 02:01 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  124
Joined  04-16-2007

Alright, I’ll try with no db, even though Im pretty sure it’s all UTF-8.

Some visual “candy” on the problem:

http://home.online.no/~janerboe/collapse.gif

 Signature 

EVERY TIME YOU ASK ABOUT CODEIGNITER 2.0… PHIL STURGEON KILLS A KITTEN

Profile
 
 
Posted: 21 January 2008 07:29 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  01-20-2008

It does not work for me. I’m getting ???? for čćđž in html.
Document encoding is utf-8 too just like html encoding.

Using meta:
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />

Profile
 
 
Posted: 21 January 2008 07:37 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  4716
Joined  03-23-2006

Could you post the minimal view required to recreate this?  I’d be happy to test on my setup.

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
MojoMotor - The Publishing Engine That Does Less!

Profile
MSG
 
 
Posted: 21 January 2008 07:43 PM   [ Ignore ]   [ # 7 ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  01-20-2008

It works! But now I have the same problem with letters collapsing into each other.

Profile
 
 
Posted: 21 January 2008 08:51 PM   [ Ignore ]   [ # 8 ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  01-20-2008

I deinstalled all extensions on server and downloaded new from PDFlib homepage and now everything works great!

Profile
 
 
Posted: 23 January 2008 10:34 AM   [ Ignore ]   [ # 9 ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  01-20-2008

Did anyone succeed in creating symbols inside pdf with dompdf without utf-8 support?
€ does not works for me.

Profile
 
 
Posted: 13 February 2008 03:26 PM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  124
Joined  04-16-2007

Good news on the DomPDF/UTF-8 issue:

http://sourceforge.net/forum/message.php?msg_id=4754104

 Signature 

EVERY TIME YOU ASK ABOUT CODEIGNITER 2.0… PHIL STURGEON KILLS A KITTEN

Profile
 
 
Posted: 19 April 2008 11:07 AM   [ Ignore ]   [ # 11 ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  01-20-2008

Great!! I can’t wait to try it!

Profile
 
 
Posted: 19 April 2008 03:02 PM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  142
Joined  04-18-2007

Have you tried TCPDF? It support utf8, some html, it’s based on fpdf, though. Looks like it’s regularly updated and has a bunch of nice examples with header/footer, html, js+forms. etc.

TCPDF
TCPDF Examples

Profile
 
 
Posted: 20 April 2008 11:54 AM   [ Ignore ]   [ # 13 ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  01-20-2008

Yes, but it does not support html as good as DOMPDF does. It’s to slow and only in theory it has HTML support.
DOMPDF really uses DOM and works fast and well.

I tried them all -UFPDF, FPDF, TCPDF, CPDF, PDFlib.. they all works somehow, but in action they make more problems then solutions.

Profile
 
 
Posted: 21 April 2008 01:36 PM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  142
Joined  04-18-2007

Well, if you are in hurry, you could use it as a workaround while waiting for next dompdf version. It looks like the author’s been working on utf support since 2006:

http://sourceforge.net/forum/message.php?msg_id=3810495

Profile
 
 
Posted: 02 May 2008 12:10 PM   [ Ignore ]   [ # 15 ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  01-20-2008

I know about PDFLib but in hosted version it cost USD 1.000 and I can’t install it on hosted server.

This fix above for DOMPDF is just embeded TCPDF, so it realy sucks. Thanks for help.


I’ll just have to accept the fact that there is no way to create large pdf documents with php.

I need really fast app that can create pdf files on the fly, large documents with 1-50 pages.
I think I will look for some Java apps and connect it with php.

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 149967 Total Logged-in Users: 41
Total Topics: 103610 Total Anonymous Users: 4
Total Replies: 518110 Total Guests: 446
Total Posts: 621720    
Members ( View Memberlist )