Re: Greek font contents in PDF

52 views
Skip to first unread message
Message has been deleted

Grant McLean

unread,
Oct 18, 2011, 3:58:32 PM10/18/11
to pdf-...@googlegroups.com
On Tue, 2011-10-18 at 05:20 -0700, Panagiotis Argiropoulos wrote:
> Is it possible to use the perl package PDF::Reuse in order to write
> Greek font contents in PDF file using functions prText and
> prBookmark ?

The easiest way is if you use a TrueType font rather than relying on the
built-in PDF fonts. You must have the Font::TTF and Text::PDF modules
installed.

#!/usr/bin/perl

use strict;
use warnings;
use utf8;

use PDF::Reuse;

my $font_path = '/usr/share/fonts/truetype/msttcorefonts/Arial.ttf';
my $output_file = 'ttf-greek.pdf';

prFile($output_file);

prTTFont($font_path);
prFontSize(20);

prText(100, 700, 'Μπορώ να έχω μια μπύρα παρακαλώ.');

prEnd();

Regards
Grant

Panagiotis Argiropoulos

unread,
Oct 21, 2011, 4:37:07 AM10/21/11
to PDF-Reuse
I run this program on Windows XP with "my $font_path = 'C:/WINDOWS/
Fonts/Arial.ttf';" but I get the following error:

Use of uninitialized value $offset in right bitshift (>>) at C:/Perl/
site/lib/Font/TTF/Loca.pm line 139.


On 18 Οκτ, 15:20, Panagiotis Argiropoulos

Grant McLean

unread,
Oct 21, 2011, 6:58:38 PM10/21/11
to pdf-...@googlegroups.com
I haven't seen that specific error but there was some weird behaviour
that was fix by upgrading Font::TTF. Do you know if you have the latest
version of Font::TTF?

Grant

George Soulis

unread,
Dec 27, 2013, 5:33:43 PM12/27/13
to pdf-...@googlegroups.com
I've been using this way to create PDF files with greek text in them. The only problem I've had is that the text I'm addin with prText can not be searched for with Acrobat Reader's search function (or any other PDF viewer)

Any text added with a font selected by prTTFont() is not searcahble.

Any ideas on how to fix this?
Reply all
Reply to author
Forward
0 new messages