Rob
Rob

Reputation: 738

FPDF Text with HTML tags

I'm using FPDF to create an A4 sized PDF, I can add text/images and this is working fine. I have a dynamically generated string which contains some HTML tags (BR etc) and was wondering how I can have that output onto the PDF as opposed to literally printing the tags out.

$centre = urldecode($row_CertDetails['centre_name']);

$pdf->Text(10, 110, $centre);

I've seen on some forums people mentioning WriteHTML, however my version of FPDF doesn't seem to include that.

Is it an add-on?

Upvotes: 0

Views: 23570

Answers (2)

Rob
Rob

Reputation: 738

I've solved it anyway.

Because I'm also using FPDI, what I did was extract the contents of the class in http://www.fpdf.org/en/script/script42.php and put it inside the FPDI.php file.

Upvotes: 0

hakre
hakre

Reputation: 198237

Yes, it is an Add-On:

Write HTML

Author: Clément Lavoillotte
License: FPDF

This is an enhancement of the WriteHTML() method from tutorial 6. Supported tags are: ...

Please see Write HTML FPDF Script #42 which I think is the latest version, but feel free to browse the FPDF scripts/Add-Ons.

Upvotes: 2

Related Questions