Performs multiple coordinate transformations at once, in the order recommended by the PDF specification (translate, rotate, scale, then skew). This is equivalent to making each transformation separately. As a valued partner and proud supporter of MetaCPAN, StickerYou is happy to offer a 10% discount on all Custom Stickers, Business Labels, Roll Labels, Vinyl Lettering or Custom Decals. StickerYou.com is your one-stop shop to make your business stick. Use code METACPAN10 at checkout to apply your discount.
Active4 years, 5 months ago
I used to set my PDF::API2 fonts like this in my Perl script, it worked fine:
Then when I wanted to print unicode characters (Russian Cyrillic characters) it did not work. I found out, that you have to use TrueType fonts and then all these special characters would work. So I tried this:
Before I copied the file 'times.ttf' from my Windows font directory to any directory where PDF::API2 could be looking: The directory where my script is located, the directory where PDF::API2 is located, and several other directories. But I always got an 'Internal Server Error' message. The script runs on a Linux server. I also tried that:
(I created 'external_ttfs' before as a sub directory of PDF::API2's 'PDF' directory. It did not work either. I thought maybe the problem could be the 'times.ttf' file, it might not have the correct format. So I downloaded 'DejaVuSans.ttf', a free font. I copied also this file to various directories of my webspace. But also this command caused the internal server error:
Does anybody have an idea what could be the problem? Thank you in advance! I don't have a clue if the TTF file is not correct, if it cannot be found, or if there is any other problem.
user3809670user3809670
2 AnswersYum Install Perl-pdf-api2vsinghvsingh
4,04311 gold badge4343 silver badges4646 bronze badges
Do you install the Font:TTF module on Perl?Download it from here and add it to Perl lib folder then retry.
SRFSRF
Not the answer you're looking for? Browse other questions tagged pdf-generationtrue-type-fonts or ask your own question.
Active4 years, 4 months ago
Below is complete minimal code required to create a single PDF file using Perl module PDF::API2. The first PDF is created fine. At the start of the attempt to create the second PDF, the process fails at the second instance of line:
with the error,
Can't call method 'new_obj' on an undefined value at C:/Perl64/site/lib/PDF/API2/Basic/PDF/Pages.pm line 92.
Perl Pdf Api2 Image
Why? More importantly, what change do I have to make to create a second pdf?
Karl
KarlKarl
1,11811 gold badge1717 silver badges3232 bronze badges
2 Answers
Using
Data::Dumper after first creating $pdf reveals a lot of data:
This is all removed after the call to
saveas , causing the undefined value error:
You could recreate
$pdf :
but then you'd also need to add all the other method calls (
corefonts , mediabox , text ). Easier to put the PDF creation code into a sub:
Then call it twice with relevant arguments.
Full working example:
Archived from on 2011-04-08. Retrieved 2015-01-12. World of keflings pc download.
RobEarl
Perl Pdf Api2 Text_blockRobEarl
7,16666 gold badges2929 silver badges4848 bronze badges
ShellFish
3,74611 gold badge1212 silver badges3030 bronze badges
faceface
Not the answer you're looking for? Browse other questions tagged perlpdf or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |