Your message dated Thu, 9 Sep 2010 22:33:13 +0200
with message-id <[email protected]>
and subject line Re: Bug#595900: libpdf-api2-perl: Using TTF creates corrupt PDF
has caused the Debian Bug report #595900,
regarding Text written with TTF not extracted by pdftotext
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
595900: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595900
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libpdf-api2-perl
Version: 0.73-1
Severity: normal

Attached are two test scripts, one using a core font one using TTF.

The core example runs without errors and the text in the resulting PDF can be 
extracted by pdftotext.

The TTF example produces multiple errors on running and evince prints errors on 
opening the PDF, although it displays the text. pdftotext fails to extract the 
text.


-- System Information:
Debian Release: squeeze/sid
  APT prefers lucid-updates
  APT policy: (500, 'lucid-updates'), (500, 'lucid-security'), (500, 
'lucid-backports'), (500, 'lucid')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-24-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libpdf-api2-perl depends on:
ii  perl [libcompress-zlib-perl]  5.10.1-13  Larry Wall's Practical Extraction 
ii  ttf-dejavu                    2.30-2     Metapackage to pull in ttf-dejavu-

libpdf-api2-perl recommends no packages.

libpdf-api2-perl suggests no packages.

-- no debconf information
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 01core.t'
# make test TEST_VERBOSE=1 gives you more info

use Test::More tests => 2;
use strict;
BEGIN { use_ok('PDF::API2') };

my $pdf = PDF::API2-> new(-file => 'test.pdf');
my $page = $pdf->page;
my $font = $pdf->corefont('Times-Roman');
my $text = $page->text;
my $size = 12;
$text->font( $font, $size );
$text->translate( 100, 500 );
$text->text( "My text" );
$pdf->save;
$pdf->end;

my $output = `pdftotext test.pdf -`;
print "pdftotext output: \"$output\"";

ok($output =~ /My text/, 'text can be found by pdftotext');

1;
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 02ttf.t'
# make test TEST_VERBOSE=1 gives you more info

use Test::More tests => 2;
use strict;
BEGIN { use_ok('PDF::API2') };

my $pdf = PDF::API2-> new(-file => 'test.pdf');
my $page = $pdf->page;
my $font = $pdf->ttfont( 'DejaVuSans.ttf' );
my $text = $page->text;
my $size = 12;
$text->font( $font, $size );
$text->translate( 100, 500 );
$text->text( "My text" );
$pdf->save;
$pdf->end;

my $output = `pdftotext test.pdf -`;
print "pdftotext output: \"$output\"";

ok($output =~ /My text/, 'text can be found by pdftotext');

1;

--- End Message ---
--- Begin Message ---
The option was well hidden. Calling the font with the -unicodemap
option causes the /ToUnicode map to be written, and thus pdftotext can
extract the text (and evince can copy it).

#!/usr/bin/perl -w
use strict;
use PDF::API2;
my $pdf = PDF::API2-> new(-file => 'test.pdf');
my $page = $pdf->page;
my $font = $pdf->ttfont( 'DejaVuSans.ttf', -unicodemap => 1 );
my $text = $page->text;
my $size = 12;
$text->font( $font, $size );
$text->translate( 100, 500 );
$text->text( "My text" );
$pdf->save;


--- End Message ---

Reply via email to