TCPDF error: Could not include font definition file

General questions regarding the use of languages in Joomla! 1.5.

Moderator: General Support Moderators

Locked
magnetall
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Fri Jan 25, 2008 8:16 am

TCPDF error: Could not include font definition file

Post by magnetall » Tue May 06, 2008 2:15 pm

How to fix TCPDF error: Could not include font definition file" error while open PDF file?

jem618
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Feb 11, 2008 12:37 pm

Re: TCPDF error: Could not include font definition file

Post by jem618 » Fri May 09, 2008 1:17 am

I've also been searching for an answer to this problem for a few days now...

A few details:
1.5.3 clean install in English front and back end.
Latest language pack for Japanese installed on the front end as default language.

When printing to PDF, a window pops up with the following:

~ /joomla/language/pdf_fonts/sazanami-gothic.php) [function.TCPDF-include]: failed to open stream: No such file or directory in ~ /joomla/libraries/tcpdf/tcpdf.php on line 1909


Warning: TCPDF::include() [function.include]: Failed opening ~ joomla/language/pdf_fonts/sazanami-gothic.php' for inclusion (include_path='.:/usr/local/lib/php-5.2.1/lib/php') in ~ joomla/libraries/tcpdf/tcpdf.php on line 1909

TCPDF error: Could not include font definition file

So, I go to the language/pdf_fonts folder, and sure enough, the sazanami-gothic.php and the accompanying font file doesn't exist.

I imagine that the font files for the PDFs are created during the install.

Is there anyway of getting these two files, short of reinstalling Joomla in Japanese and copying them?

Also, since I thought this was language realated, as did the OP, I posted here, if I should post elsewhere, please advise.

jem618
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Feb 11, 2008 12:37 pm

Re: TCPDF error: Could not include font definition file

Post by jem618 » Fri May 09, 2008 2:15 am

I downloaded and unzipped a complete Japanese J1.5 package.

The missing font files were there.

Uploaded them and the error disappears!!

So perhaps it's as simple as finding the font files for the languages you're using and uploading them.

The only problem, now there's a new error....

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 9920951 bytes) in ~/joomla/plugins/system/sef.php on line 58

Oh well, one step at a time.

jyakkudesu
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu May 29, 2008 2:57 am

Re: TCPDF error: Could not include font definition file

Post by jyakkudesu » Thu May 29, 2008 3:01 am

I am running into the same problem. I have followed your suggestions. The original error disappeared, however the resulting page after PDF conversion shows garbled characters beginning with the following: %PDF-1.5 3 0 obj <> endobj 4 0 obj <> stream x��XMs�F������Ȓ@ and so on, and so on.
Any suggestions?

jem618
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Feb 11, 2008 12:37 pm

Re: TCPDF error: Could not include font definition file

Post by jem618 » Thu May 29, 2008 4:08 am

I just gave up!

It's nice to have that functionality if it works, but it seems to be more trouble than it's worth for now.

Sorry.

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

Re: TCPDF error: Could not include font definition file

Post by infograf768 » Sun Jun 01, 2008 6:40 am

Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

jyakkudesu
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu May 29, 2008 2:57 am

Re: TCPDF error: Could not include font definition file

Post by jyakkudesu » Sun Jun 01, 2008 7:35 am

Thank you for the link. I can feel in my bones it's gonna be good, but what to do with it?
Thanks in advance.

User avatar
bass28
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 137
Joined: Mon Apr 17, 2006 5:11 pm

Re: TCPDF error: Could not include font definition file

Post by bass28 » Wed Jul 30, 2008 3:44 pm

I've been playing with this alot lately...

If you replace the version of tcpdf with the latest from the website you need to copy all the files found in the fonts folder of the new tcpdf to your Joomla language/pdf_fonts folder. Also, the garbage text is a browser issue. Close your browser window and try again.

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

Re: TCPDF error: Could not include font definition file

Post by infograf768 » Wed Jul 30, 2008 4:48 pm

bass28 wrote:If you replace the version of tcpdf with the latest from the website you need to copy all the files found in the fonts folder of the new tcpdf to your Joomla language/pdf_fonts folder.
Not really, you just need the fonts defined in the language files you are using.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
binc
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Mar 22, 2006 7:13 pm
Location: Amsterdam

Re: TCPDF error: Could not include font definition file

Post by binc » Tue Aug 05, 2008 7:59 am

Hi,

When printing to PDF I get this error:

Code: Select all

Warning: TCPDF::include(D:/Inetpub/wwwroot/_OPENSOURCE/tcpdf/fonts/freesans.php) [function.TCPDF-include]: failed to open stream: No such file or directory in /home/zqbase6/public_html/binc/adogable/libraries/tcpdf/tcpdf.php on line 1909

Warning: TCPDF::include(D:/Inetpub/wwwroot/_OPENSOURCE/tcpdf/fonts/freesans.php) [function.TCPDF-include]: failed to open stream: No such file or directory in /home/zqbase6/public_html/binc/adogable/libraries/tcpdf/tcpdf.php on line 1909

Warning: TCPDF::include() [function.include]: Failed opening 'D:/Inetpub/wwwroot/_OPENSOURCE/tcpdf/fonts/freesans.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/zqbase6/public_html/binc/adogable/libraries/tcpdf/tcpdf.php on line 1909
TCPDF error: Could not include font definition file
I have don everything I could find about this error on divergent forms but I can’t fix it. Can somebody help me. What am I doing wrong?

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

Re: TCPDF error: Could not include font definition file

Post by infograf768 » Tue Aug 05, 2008 9:04 am

The 3 files necessary to use Freesans are absent from the folder defined i.e. in
D:/Inetpub/wwwroot/_OPENSOURCE/tcpdf/fonts/
Unpack a full version of joomla locally and upload via ftp the files concerned.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

ryuuguu
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Sep 21, 2008 4:55 am

Re: TCPDF error: Could not include font definition file

Post by ryuuguu » Sun Sep 21, 2008 5:04 am

I am having the exact same problem as described by the first two post above, with version 1.5.7. The Third post mentions downloading a complete japanese J1.5 and the files being there. I could not find a Japanese complete version only Japanese language files which did not contain any files for pdf directory.

I looked at http://joomlacode.org/gf/project/pdffonts15/frs/ but there are no sazanami-gothic.php or accompanying font files on that page. Japanese zip file on that page is ipag files.

So doe anyone know where to get the sazanami-gothic.php and accompanying font files or hw to disable the PDF button. The PDF function is nice but it is better not have it than to have a broken button.

Cheers,
Grant

OK Found the files. they are here
http://svn.joomla.jp/listing.php?repnam ... v=402&sc=0
you get the tarball beside pdf_fonts/ open it on your local machine and copy the there files in to your pdf_fonts directory on your server. It un tars to a directory -- pdf_fonts.r402 -- so if you open it directly on the server you will have move the files.

WINEMAN
Joomla! Intern
Joomla! Intern
Posts: 92
Joined: Mon Aug 29, 2005 11:15 am
Location: Japan

Re: TCPDF error: Could not include font definition file

Post by WINEMAN » Wed Sep 24, 2008 3:59 am

infograf768, as always, thanks for your input and support.

I, too, am having issues with sazami vs. ipag.
Should we change the .xml file to reflect the new font name or should we install the sazami font files from the Japanese full install pack ?

I wonder.

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

Re: TCPDF error: Could not include font definition file

Post by infograf768 » Wed Sep 24, 2008 8:20 am

The japanese language xml file should be changed and the 3 pdf files uploaded in the pdf_fonts folder.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

WINEMAN
Joomla! Intern
Joomla! Intern
Posts: 92
Joined: Mon Aug 29, 2005 11:15 am
Location: Japan

Re: TCPDF error: Could not include font definition file

Post by WINEMAN » Wed Sep 24, 2008 1:26 pm

infograf768 wrote:The japanese language xml file should be changed and the 3 pdf files uploaded in the pdf_fonts folder.
Ok, so just to confirm... I need to :
(1)
Open the ja-JP.xml file and change the following line from
<pdfFontName>sazanami-gothic</pdfFontName>
to
<pdfFontName>ipag</pdfFontName>

and then...
(2)
Upload the IPAG zip file contents to the PDF Fonts folder ?

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

Re: TCPDF error: Could not include font definition file

Post by infograf768 » Wed Sep 24, 2008 4:42 pm

Yes... but I think we may have licensing issue with ipag and that's why Nori is now using Sazanami-gothic.
I have uploaded Sazanami-gothic to our repository:
http://joomlacode.org/gf/project/pdffon ... tion=index
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

WINEMAN
Joomla! Intern
Joomla! Intern
Posts: 92
Joined: Mon Aug 29, 2005 11:15 am
Location: Japan

Re: TCPDF error: Could not include font definition file

Post by WINEMAN » Thu Sep 25, 2008 1:33 am

Well, the IPAG fix worked just fine.
I'll try the sazami fix later.
I appreciate the support !

adbuster
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Dec 19, 2007 12:04 pm

Re: TCPDF error: Could not include font definition file

Post by adbuster » Wed Oct 21, 2009 8:44 am

Hi, guys and girls

It seems that there are some standard for handling and creating php fonts in Joomla!

However, I have been looking a lot for how to make new fonts to show up in pdf.


Anyone?

How to make Century Gothic and Garamond fonts show up when generating pdf?


Would really much appreciate a good answer from you who know.

Thanks a million in advance.

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

Re: TCPDF error: Could not include font definition file

Post by infograf768 » Wed Oct 21, 2009 9:49 am

adbuster wrote:Hi, guys and girls

It seems that there are some standard for handling and creating php fonts in Joomla!

However, I have been looking a lot for how to make new fonts to show up in pdf.


Anyone?

How to make Century Gothic and Garamond fonts show up when generating pdf?


Would really much appreciate a good answer from you who know.

Thanks a million in advance.
Why would you even try to do that?
1, These fonts are not free/GPL and we can't make pdf fonts with them.
2. They are never used on internet as most users don't have them installed on their systems.

EDIT: it's not that we can't make pdf font with these using the right tools, the matter is that these fonts can't be legally distributed or used this way without the owner's authorization (Adobe or whatever the foundry copyrighting them.)
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
conorweb
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Feb 01, 2009 2:45 pm
Location: Hungary, Budapest
Contact:

Re: TCPDF error: Could not include font definition file

Post by conorweb » Wed Nov 18, 2009 9:36 pm

Hi,

am I still suffering with this "TCPDF error: Could not include font definition file".

I have all the fonts in language/pdf_fonts/ but it is still not showing any PDF just the above mentioned TCPDF error.

Any clue? Does anyone know what other files are needed besides the stuff in libraries/tcpdf?

Any help would be much appreciated!

Thanks in advance!

G
--------whatever-------------------

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

Re: TCPDF error: Could not include font definition file

Post by infograf768 » Thu Nov 19, 2009 9:03 am

conorweb wrote:Hi,

am I still suffering with this "TCPDF error: Could not include font definition file".

I have all the fonts in language/pdf_fonts/ but it is still not showing any PDF just the above mentioned TCPDF error.

Any clue? Does anyone know what other files are needed besides the stuff in libraries/tcpdf?

Any help would be much appreciated!

Thanks in advance!

G
Please post the full error message.
It should indicate which font it is looking for.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
conorweb
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Feb 01, 2009 2:45 pm
Location: Hungary, Budapest
Contact:

Re: TCPDF error: Could not include font definition file

Post by conorweb » Thu Nov 19, 2009 12:51 pm

Hello,

That was actually the whole error message, it did not say what it was looking for. I have played around with it over night. Now it opens a pdf, but the pdf is empty. And also it only opens in firefox, nothing happens when trying to open in IE. The preview site can be seen here: http://www.conorweb.hu/gyermekseb/

If you click on the pdf icon on the main page, you can also see what happens.

Thanks for your help:)

Sincerely,

Gabor
--------whatever-------------------

User avatar
conorweb
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Feb 01, 2009 2:45 pm
Location: Hungary, Budapest
Contact:

Re: TCPDF error: Could not include font definition file

Post by conorweb » Thu Nov 19, 2009 1:09 pm

More details on that site:

Joomla! 1.5.15
Legacy mode is on because of Fireboard.
PHP Version 5.2.6-1+lenny3
All core SEF is on.
.htaccess is used
utf-8 encoding is used for Hungarian language.
--------whatever-------------------

User avatar
conorweb
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Feb 01, 2009 2:45 pm
Location: Hungary, Budapest
Contact:

Re: TCPDF error: Could not include font definition file

Post by conorweb » Thu Nov 19, 2009 5:02 pm

Dear Everybody!

ISSUE IS RESOLVED:

The "TCPDF error: Could not include font definition file" error is caused by messy html code in the content. After hours of research on this issue, i was trying to copy sql tables one-by-one from clean install of joomla to my site. After getting to jos_content and finished copying I realized that the PDF is now working. So that took me to the conclusion that it's a content problem.
After looking at my contents' in HTML code in the back-end I saw, that in lot of lines different font types are defined (no clue why, but the text was copy-pasted from another site) for different lines. Although this could not be seen when looking at the html output.

So clean up messy html code in the content. And PDF should now work fine!

So be careful! Messy code can come from copy-pasting from other sites! And this can lead to TCPDF malfunction.

Thanks for all the help anyways!

Sincerely,

Gabor Conway
--------whatever-------------------

kelvinminn
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Dec 03, 2009 4:17 pm

Re: TCPDF error: Could not include font definition file

Post by kelvinminn » Thu Dec 03, 2009 4:18 pm

Hi .. All;
How can I change to Burmese language Unicode fonts in PDF font where we can get free/Open Sources at http://code.google.com/p/ayarunicode/do ... =label:ttf .
Thank you for valuable works
Kelvin

doraberindea
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Jan 06, 2010 1:24 pm

Re: TCPDF error: Could not include font definition file

Post by doraberindea » Wed Sep 22, 2010 9:40 am

I found the source of error:
there is in 0:/public_html/libraries/tcpdf/config/ the file tcpdf_config.php
In this file there are this two lines:
define ("K_PATH_MAIN", "D:/Inetpub/wwwroot/_OPENSOURCE/tcpdf/");

define ("K_PATH_URL", "http://localhost/_OPENSOURCE/tcpdf/");

you have to put your own path
e.g.

define ("K_PATH_MAIN", "/home/homeuser/public_html/libraries/tcpdf/");

kashifmoin
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Aug 12, 2008 6:47 am

Re: TCPDF error: Could not include font definition file

Post by kashifmoin » Mon May 16, 2011 4:52 am

TCPDF error: Could not include font definition file I am using arabic website and i am gettign this error when I am trying to do pdf.. need yoru assistance..


my url is http://www.dcd.gov.ae/dcdold/index.php? ... 7-04-56-43


please hlp me..


Locked

Return to “Language - Joomla! 1.5”