| CAM-PDF documentation | Contained in the CAM-PDF distribution. |
CAM::PDF::Renderer::Dump - Print the graphic state of each node
See CAM::PDF.
use CAM::PDF;
my $pdf = CAM::PDF->new($filename);
my $contentTree = $pdf->getPageContentTree(4);
$contentTree->render("CAM::PDF::Renderer::Dump");
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.
Prints the string prefixed by its device and user coordinates.
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__