I am using API2 package (to generate PDF report) for the first time and trying to test it via simple Hello World Code. The moment I try to write something to the pdf file, I get errors from Content.pm. If i simply create new file and save it, it does create blank pdf file. I am working in Linux environment.If there is another way to generate pdf report, please let me know.
This is my code:and got this error:use PDF::API2; use PDF::API2::Util; my $pdf = PDF::API2->new(); my $font = $pdf->corefont('Times-Roman'); my $page = $pdf->page; $page->mediabox(595,842); my $gfx=$page->gfx; $gfx->textlabel(50,780,$font,20,"Hello World! (3)"); #my $headline_text = $page->text; #$headline_text->text("Hello World"); $pdf->saveas("/tmp/HelloWorld.pdf"); $pdf->end();
error: Undefined subroutine &Compress::Zlib::compress called at /usr/l +ib/perl5/site_perl/5.8.0/PDF/API2/Content.pm line 102. context: ... 98: delete($self->{" $k"}); 99: } 100: if($self->{-docompress}==1 && $self->{Filter}) 101: { 102: $self->{' stream'}=Compress::Zlib::compress($self->{' stream'}); 103: $self->{' nofilt'}=1; 104: delete $self->{-docompress}; 105: } 106: $self->SUPER::outobjdeep(@_); ... code stack: /usr/lib/perl5/site_perl/5.8.0/PDF/API2/Content.pm:102 /usr/lib/perl5/site_perl/5.8.0/PDF/API2/Basic/PDF/File.pm:953 /usr/lib/perl5/site_perl/5.8.0/PDF/API2/Basic/PDF/File.pm:1255 /usr/lib/perl5/site_perl/5.8.0/PDF/API2/Basic/PDF/File.pm:500 /usr/lib/perl5/site_perl/5.8.0/PDF/API2/Basic/PDF/File.pm:436 /usr/lib/perl5/site_perl/5.8.0/PDF/API2.pm:893 /usr/local/apache/html/bioinfo/pfc/view/view_dige.mhtml:52 /usr/local/apache/html/bioinfo/pfc/view/autohandler:107 /usr/local/apache/html/bioinfo/pfc/view/syshandler:42
In reply to Errors while generating PDF report by nargis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |