#!/usr/bin/perl use PDF::API2; $max_x = 612 ; $max_y = 792 ; $pdf = new PDF::API2 ; $pdf->default ( "Compression" , 0 ) ; $page = $pdf->page ; $page->mediabox ( $max_x , $max_y ) ; $txt = $page->text ; $y = ( $max_y - 36 ) - 12 ; foreach $fn ( qw ( Courier Helvetica Symbol Times-Roman ) ) { $font=$pdf->corefont ( $fn , 1 ) ; $txt->font ( $font , 12 ) ; $txt->translate ( 36 , $y ) ; $txt->text ( $fn ); $y -= 12 ; } $font = $pdf->ttfont ( "lucon.ttf" ) ; $txt->font ( $font , 12 ) ; $txt->translate ( 36 , $y ) ; $txt->text ( "Lucida Console" ) ; # draw a box? $gfx = $page->gfx ; $gfx->linewidth ( 0.5 ) ; $gfx->strokecolor ( 0 ) ; $gfx->rectxy ( 0 , 0 , $max_x , $max_y ) ; $gfx->stroke ; $y = $max_y - 36 ; $gfx->rectxy ( 36 , 36 , $max_x - 36 , $y ) ; $gfx->stroke ; $gfx->linewidth ( 0.2 ) ; $txt->font ( $font , 4 ) ; while ( $y > ( $max_y / 2 ) ) { $y -= 12 ; $gfx->move ( 36 , $y ) ; $gfx->line ( $max_x - 36 , $y ) ; $gfx->stroke ; $txt->translate ( 35 , $y ) ; $txt->text_right ( $y ) ; } $pdf->saveas ( "testing.pdf" ) ;