Package: libpdf-api2-perl Version: 2.019-1 Severity: normal I have a program that processes lots of text into different formats, including PDF. For consistency and ease of use, I use U+2002 (EN SPACE) to indent some text. However, PDF::API2 seems to ignore these completely: it is as if they were not present at all.
I have tried the generated PDF in evince and in Google Chrome's PDF viewer, and in both cases no space is emitted. U+2002 is a perfectly valid Unicode character and should be emitted as a space equivalent to half the point size. If this requires special magic, PDF::API2 should either handle it automatically, or die with an informative error message. I have attached a sample program which demonstrates the problem. If I change the U+2002 characters into U+2022 (BULLET) characters, they are rendered correctly. The text should be indented 60 points from the left margin, but it is not. U+2003 (EM SPACE) is similarly broken. -- System Information: Debian Release: 7.0 APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.7-trunk-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages libpdf-api2-perl depends on: ii libfont-ttf-perl 1.02-1 ii perl 5.14.2-16 ii ttf-dejavu 2.33-3 libpdf-api2-perl recommends no packages. libpdf-api2-perl suggests no packages. -- no debconf information -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
#!/usr/bin/perl use v5.14; use PDF::API2; my $pdf = PDF::API2->new(); my $page = $pdf->page; $page->mediabox("Letter"); my $font = $pdf->corefont("Times-Roman"); my $text = $page->text(); $text->font($font, 30); $text->translate(0, 100); $text->text("\x{2002}\x{2002}\x{2002}\x{2002}This should be indented."); print $pdf->stringify;
signature.asc
Description: Digital signature