Page 1 of 1

fpdf procedure not working download

Posted: Sun Dec 17, 2023 10:29 pm
by andrea763
Hi i'm trying to use the following code to create a pdf from scratch and run it in a procedure.
For various reason i'm not able to use the default report builder..
So the following code works properly locally on the server with php script, but in a procedure it does not..
It opens an empty page and nothing else.
I'd try tcpdf but it seems more complex and i'm not able to make it work .. like this piece of code..

<?php
require('core/libs/fpdf/fpdf.php');

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
$filename="pdfsource/test2.pdf";
$pdf->Output('F',$filename);
?>

Re: fpdf procedure not working download

Posted: Mon Dec 18, 2023 9:05 am
by kev1n
Hi,

Remove the PHP tags and update the require line as follows:

Code: Select all

require('libs/fpdf/fpdf.php');

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
$filename="pdfsource/test2.pdf";
$pdf->Output('F',$filename);

Re: fpdf procedure not working download

Posted: Mon Dec 18, 2023 2:53 pm
by andrea763
it works.
thanks..