in reply to How can I print hash content to pdf file ?

You could create a table of the data with PDF::Table

#!/usr/bin/perl use strict; use PDF::API2; use PDF::Table; # test hash my @cols = qw(name class other); my %data = (); for my $i ('001'..'100'){ for (@cols){ $data{'id'.$i}{$_} = $_.$i; } }; # create data array my @tbl; push @tbl ,\@cols; for my $id (sort keys %data){ push @tbl, [ @{$data{$id}}{@cols} ]; } # create pdf my $pdf = new PDF::API2(-file => "table_of_data.pdf"); $pdf->mediabox(595, 842); # A4 my $page = $pdf->page; my $pdftable = new PDF::Table; my (undef, undef, $boty) = $pdftable->table( $pdf, $page, \@tbl, x => 50, w => 495, start_y => 800, next_y => 800, start_h => 750, next_h => 750, padding => 5, padding_right => 10, ); $pdf->saveas();
poj