package MyTestRenderer; use strict; use warnings; use base 'CAM::PDF::GS'; sub new { my ( $class, @args ) = @_; my $self = $class-> SUPER::new( @args ); $self-> { mode } = 'c'; # split into characters return $self } sub renderText { my ( $self, $string, $width ) = @_; my $fontsize = $self-> { Tfs }; my ( $xu, $yu ) = $self-> textToUser( 0, 0 ); my ( $xd, $yd ) = $self-> userToDevice( $xu, $yu ); printf "(x = %5.1f, y = %5.1f) (w = %.3f, h = %3.1f) %s\n", $xd, $yd, $width, $fontsize, $string; return; } 1;