in reply to How can I print hash content to pdf file ?
Have you checked that you get the correct data and can print it to the screen instead of a PDF file?
use strict; use PDF::API2::Simple; my %data = (...); #my $pdf = PDF::API2::Simple->new( file => 'file.pdf' } foreach my $keys( sort { $data{$a} <=> $data{$b}} keys %data ){ print $data{$keys}{'Name'}, "\n"; }
The next thing would be to check that you can actually print to the PDF file. Try printing a plain list to a PDF file:
use strict; use PDF::API2::Simple; my @names = (Diana Bruce Clark); my $pdf = PDF::API2::Simple->new( file => 'file.pdf' } foreach my $name( @names ){ $pdf->text($name}); }
One of the two programs should work for you and should help you determine where your problem lies, in the data or in writing the data to the PDF.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I print hash content to pdf file ?
by vkk05 (Initiate) on Dec 10, 2017 at 09:26 UTC | |
by Corion (Patriarch) on Dec 10, 2017 at 09:28 UTC | |
by vkk05 (Initiate) on Dec 10, 2017 at 11:31 UTC | |
by Corion (Patriarch) on Dec 10, 2017 at 11:51 UTC |