Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use CGI qw(:header); use CGI::Carp qw(fatalsToBrowser); use CGI qw/:standard/; use DBI; use PDF::API2; use PDF::Table; print header(); my $pdftable = new PDF::Table; my $pdf = new PDF::API2( -file => "pdf_table.pdf" ); $pdf->preferences( -singlepage => 1, -thumbs => 1, -fith => 1, ); my $page = $pdf->page; $page->mediabox(792,612); #*Connect with sql dbonce::: my $db = "LocalServer"; #... my $sql = "SELECT DISTINCT name, email ,phone, city, state FROM details LEFT OUTER JOIN main ON details.name = main.na +me "; my $sth = $dbh->prepare($sql)|| die $dbh->errstr; $sth->execute() or die "$!\n"; my $array_ref = $sth->fetchall_arrayref(); my $c=0; my $rows=750; my $left_edge_of_table = 10; $pdftable->table( # required params $pdf, $page, \@{$array_ref}, x => $left_edge_of_table, w => 495, # width of table start_y => 590, # top of page next_y => 800, # top of all other pages start_h => 500, # rows per page next_h => 500, # rows per page on all other pages # optional params padding => 5, padding_right => 10, background_color_odd => "gray", background_color_even => "lightblue", #cell background color for +even rows ); $pdf->saveas();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Rotating a (PDF:::Table) Page Help!
by almut (Canon) on Mar 31, 2009 at 18:54 UTC | |
by Anonymous Monk on Mar 31, 2009 at 19:10 UTC | |
by Corion (Patriarch) on Mar 31, 2009 at 19:16 UTC | |
by Anonymous Monk on Mar 31, 2009 at 19:26 UTC | |
by Corion (Patriarch) on Mar 31, 2009 at 19:31 UTC | |
|