CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Suggestion #39948

Generator_TcPdf > TCPDF ERROR: Could not include font definition file: courier

Added by Uwe Schmelzer 10 months ago. Updated 10 months ago.

Status:Resolved Start date:2012-08-19
Priority:Could have Due date:
Assignee:Reinhard Führicht % Done:

0%

Category:Generator
Target version:v1.4
Votes: 0

Description

Short description

PDF creation with Generator_TcPdf fails, when I use
<pre>...</pre>
in my pdf template.
The solution could be adding font "Courier" to the TCPDF font dir.

Detailed description

Problem

1. After successfull form submission, a pdf should be created by formhandler and attached to the email

2. The pdf creation fails with this error message:
TCPDF ERROR: Could not include font definition file: courier

Cause

1. Im using Generator_TcPdf

2. The pdf template contains html markup with this tags:
<pre>...</pre>

3. This causes TCPDF to use the default monospaced font

4. In the TCPDF-Configurationfile the font "Courier" is defined as default font for monospaced

Please see FILE
/typo3conf/ext/formhandler/Resources/PHP/tcpdf/config/tcpdf_config.php

LINE
209

CODE
define ('PDF_FONT_MONOSPACED', 'courier');

4. The courier font is missing in the font dir

5. You might have deleted the courier font files, when deleting some of unneeded fonts, in order to free some space. At least, this was what happened to to me, when I used TCPDF in another project ;-)

Please see DIRECTORY
/typo3conf/ext/formhandler/Resources/PHP/tcpdf/fonts/

Suggested Solution

1. Please add Font "Courier" to font dir
/typo3conf/ext/formhandler/Resources/PHP/tcpdf/fonts/

2. These are the missing filenames:
courier.php
courierb.php
courierbi.php
courieri.php

3. You will get the files with the latest TCPDF tarball from
http://sourceforge.net/projects/tcpdf/files/

My Environment

-Formhandler 1.3.0
-Typo3 4.5.17
-PHP 5.3
-OSX Lion

Thank You

Uwe Schmelzer

History

Updated by Uwe Schmelzer 10 months ago

Update

After some tests with glyphs of other languages,
I'd like to change the font in my suggested solution.

Old suggestion
Use "Courier"

New suggestion
Use "freemono"

Why?
"freemono" renders more glyphs in other languages. E.g. russian or greek.

Updated by Reinhard Führicht 10 months ago

  • Status changed from New to Accepted
  • Assignee set to Reinhard Führicht
  • Target version set to v1.4

Hi Uwe,

thanks for the hint!

I will update TCPDF to the current version first, then add "freemono".

Updated by Reinhard Führicht 10 months ago

  • Status changed from Accepted to Resolved

Also available in: Atom PDF