Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: PDF::Template redesign - I want your ideas!

by snoopy (Curate)
on Dec 02, 2005 at 06:41 UTC ( [id://513525]=note: print w/replies, xml ) Need Help??


in reply to PDF::Template redesign - I want your ideas!

PDF::APIx::Layout is newly released module for marking up text parapgraphs with PDF::API2. It can produce quite advanced text markup, including mixing fonts colors, with justification and reflow etc.

It would be nice to be able to utilize this stuff from PDF::Template, either through direct embedding of these tags in whatever markup language that you come up with, or through your proposed plugin scheme!

A simple 'hello world' example follows:

#!/usr/bin/perl use strict; use PDF::API2; use PDF::APIx::Layout; my $pdf=PDF::API2->new; my @fonts = ( [$pdf->corefont('Times-Roman',-encode=>'latin1'), 'default', $pdf->corefont('Times-Bold',-encode=>'latin1'), 'bold', 'regular' +] ); my $cell = PDF::APIx::Layout->MarkupText( q|<p size="15">Hello <span color="blue" face="bold">bold new</span +> world</p>|, -fontreg=>\@fonts, -background=>'#aff', -align=>'c' ); my $page = $pdf->page; my $gfx = $page->gfx; $cell->render($pdf,$page,$gfx,100,500,100,100); $pdf->saveas('/tmp/hello_world.pdf');

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://513525]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found