Les dejo el código:
Using perl Syntax Highlighting
#!/bin/perl
use PDF::Report;
my $pdf = new PDF::Report(
PageSize => 'A4',
PageOrientation => 'Portrait'
);
$pdf->newpage(1);
$pdf->setFont('Helvetica-bold');
$pdf->setSize(14);
my ($width, $height) = $pdf->getPageDimensions();
$pdf->centerString(0, $width, $height-40, "Reporte");
$pdf->setFont('Helvetica');
$pdf->setSize(10);
open (DATOS,"reporte.html");
while (@linea = <DATOS>){
my $text1= "@linea";
$pdf->addParagraph($text1, 30, $height-70, $width-60, 30, 25, 10);
}
open(PDF, "> reporte.pdf") or die "ERROR: No puedo escribir en reporte.pdf: $!\n";
print PDF $pdf->Finish();
close(PDF);
exit;
use PDF::Report;
my $pdf = new PDF::Report(
PageSize => 'A4',
PageOrientation => 'Portrait'
);
$pdf->newpage(1);
$pdf->setFont('Helvetica-bold');
$pdf->setSize(14);
my ($width, $height) = $pdf->getPageDimensions();
$pdf->centerString(0, $width, $height-40, "Reporte");
$pdf->setFont('Helvetica');
$pdf->setSize(10);
open (DATOS,"reporte.html");
while (@linea = <DATOS>){
my $text1= "@linea";
$pdf->addParagraph($text1, 30, $height-70, $width-60, 30, 25, 10);
}
open(PDF, "> reporte.pdf") or die "ERROR: No puedo escribir en reporte.pdf: $!\n";
print PDF $pdf->Finish();
close(PDF);
exit;
Coloreado en 0.005 segundos, usando GeSHi 1.0.8.4