Problem with FPDF showing date correctly
Posted: Tue Jul 07, 2009 8:00 am
I have succesfully created action etc to use FPDF to create pdfs from content in my database.
However, I'm not able to get it to print dates correctly.
Here is print_this_action.php
The
The $pdf_body prints fine. the $pdf_date shows up in the PDF as just the word Array.
Any help would be greatly appreciated.
Many thanks, Tom
However, I'm not able to get it to print dates correctly.
Here is print_this_action.php
The
- Code: Select all
import('actions/pdf.php');
- Code: Select all
<?php
define('FPDF_FONTPATH','actions/font/');
require('actions/fpdf.php');
import('actions/pdf.php');
class dataface_actions_print_this_action {
function handle(&$params){
$app =& Dataface_Application::getInstance();
$record =& $app->getRecord();
$pdf_body = $record->val('cor_body');
$pdf_date = $record->val('cor_date');
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('arial','',10);
$pdf->SetLeftMargin(20);
$pdf->SetRightMargin(20);
$pdf->Cell(190,4,'',0,1,'L',0);
$pdf->Ln(20);
$pdf->Cell(10,20,$pdf_date,0,1,'L',0);
$pdf->Ln(20);
$pdf->MultiCell(0,5,$pdf_body,0,1);
$pdf->Output();
}
}
?>
The $pdf_body prints fine. the $pdf_date shows up in the PDF as just the word Array.
Any help would be greatly appreciated.
Many thanks, Tom