CAM::PDF::Renderer::Dump - Print the graphic state of each node


CAM-PDF documentation Contained in the CAM-PDF distribution.

Index


Code Index:

NAME

Top

CAM::PDF::Renderer::Dump - Print the graphic state of each node

LICENSE

Top

See CAM::PDF.

SYNOPSIS

Top

    use CAM::PDF;
    my $pdf = CAM::PDF->new($filename);
    my $contentTree = $pdf->getPageContentTree(4);
    $contentTree->render("CAM::PDF::Renderer::Dump");

DESCRIPTION

Top

This class is used to print to STDOUT the coordinates of each node of a page layout. It is written both for debugging and as a minimal example of a renderer.

FUNCTIONS

Top

$self->renderText($string)

Prints the string prefixed by its device and user coordinates.

AUTHOR

Top

See CAM::PDF


CAM-PDF documentation Contained in the CAM-PDF distribution.
package CAM::PDF::Renderer::Dump;

use 5.006;
use warnings;
use strict;
use base qw(CAM::PDF::GS);

our $VERSION = '1.55';

sub renderText
{
   my $self = shift;
   my $string = shift;

   my ($xu, $yu) = $self->textToUser(0, 0);
   my ($xd, $yd) = $self->userToDevice($xu, $yu);

   printf "(%7.2f,%7.2f) (%7.2f,%7.2f) %s\n", $xd,$yd,$xu,$yu, $string;
   return;
}

1;
__END__