perl - Creating a table in pdf file using PDF::Report and PDF::Report::Table -


in 1 of application having requirement download pdf file report details in form of table.

for creating pdf file , writing table in it, using cpan module available in perl. pdf::report , pdf::report::table.

please find below code sample:

#!/usr/bin/perl use strict; use warnings;  use pdf::report; use pdf::report::table;  $pdf   = pdf::report->new( pagesize => 'a4', pageorientation => 'portrait' ); $table = pdf::report::table->new( $pdf );  $data = [ ['a1' , 'b1' , 'c1'], ['a2' , 'b2' , 'c2'], ['a3' , 'b3' , 'c3'], ['a4' , 'b4' , 'c4'], ['a5' , 'b5' , 'c5'], ['a6' , 'b6' , 'c6'], ['a7' , 'b7' , 'c7'], ['a8' , 'b8' , 'c8'], ['a9' , 'b9' , 'c9'], ['a10' , 'b10' , 'c10'], ['a11' , 'b11' , 'c11'], ['a12' , 'b12' , 'c12'], ['a13' , 'b13' , 'c13'], ['a14' , 'b14' , 'c14'], ['a15' , 'b15' , 'c15'], ['a16' , 'b16' , 'c16'], ['a17' , 'b17' , 'c17'], ['a18' , 'b18' , 'c18'], ['a19' , 'b19' , 'c19'], ['a20' , 'b20' , 'c20'], ['a21' , 'b21' , 'c21'], ['a22' , 'b22' , 'c22'], ['a23' , 'b23' , 'c23'], ['a24' , 'b24' , 'c24'], ['a25' , 'b25' , 'c25'], ['a26' , 'b26' , 'c26'], ['a27' , 'b27' , 'c27'], ['a28' , 'b28' , 'c28'], ['a29' , 'b29' , 'c29'], ['a30' , 'b30' , 'c30'], ['a31' , 'b31' , 'c31'], ['a32' , 'b32' , 'c32'], ['a33' , 'b33' , 'c33'], ['a34' , 'b34' , 'c34'], ['a35' , 'b35' , 'c35'], ['a36' , 'b36' , 'c36'], ['a37' , 'b37' , 'c37'], ['a38' , 'b38' , 'c38'], ['a39' , 'b39' , 'c39'], ['a40' , 'b40' , 'c40'], ['a41' , 'b41' , 'c41'], ];  $pdf->openpage; $pdf->setaddtextpos( 50, 50  ); $table->addtable( $data, 400 );   # 400 table width  $pdf->saveas( 'table.pdf' ); 

result: pdf generated 2 pages. @ continuity of page missing row data. note: i'm facing issue attach span shot of result.

issues is: missing row data. missing row data [a37, b37, c37].

please me in fixing issues. in advance help.

well, when run code get

  commandprompt > ./makepdf.pl       useless use of greediness modifier '?' in regex; marked <-- here in m/(\s{20}? <-- here )(?=\s)/ @ /usr/local/share/perl/5.20.2/pdf/table.pm line 386.     !!! warning: !!! incorrect table geometry! setting bottom margin end of sheet!      @ /usr/local/share/perl/5.20.2/pdf/report/table.pm line 94.     !!! warning: !!! incorrect table geometry! setting bottom margin end of sheet!      @ /usr/local/share/perl/5.20.2/pdf/report/table.pm line 94. 

i think that

setting bottom margin end of sheet!

and

!!! warning: !!! incorrect table geometry! 

would have it.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -