Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

fpdf procedure not working download Topic is solved

Questions related to nuBuilder Forte Reports and the Report Builder.
Post Reply
andrea763
Posts: 32
Joined: Tue Oct 17, 2023 7:41 am
Has thanked: 5 times

fpdf procedure not working download

Unread post 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);
?>
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: fpdf procedure not working download

Unread post 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);
andrea763
Posts: 32
Joined: Tue Oct 17, 2023 7:41 am
Has thanked: 5 times

Re: fpdf procedure not working download

Unread post by andrea763 »

it works.
thanks..
Post Reply