TCPDF in J4

This forum is for general questions about extensions for Joomla! 4.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
neton
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Aug 05, 2022 10:10 pm

TCPDF in J4

Post by neton » Fri Aug 05, 2022 10:19 pm

Hi everybody,
How can i use TCPDF class in joomla 4.
Where must TCPDF files be stored and how include in my component?

Thanx
Last edited by toivo on Sat Aug 06, 2022 1:29 am, edited 1 time in total.
Reason: mod note: moved from 4.x Coding

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 29127
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: TCPDF in J4

Post by Per Yngve Berg » Sat Aug 06, 2022 12:31 am


User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14782
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: TCPDF in J4

Post by toivo » Sat Aug 06, 2022 1:58 am

If you plan to use the TCPDF library to write your own PDF documents, instead of producing Joomla articles as PDF files, use Llewellyn van der Merwe's TCPDF Library.

The JED flags this extension as compatible with J3 but it can be installed also in J4. The TCPDF library itself is stored in libraries/tcpdf.

The attached Proof Of Concept (POC) module was written three years ago to follow Nicola Asuni's documentation at https://tcpdf.org/examples/example_001. The module still works in Joomla 4.1.5 but could be refactored to the latest coding standards and also perhaps display something in the selected module position. At the moment it just creates a file example_001.pdf in the images folder.

mod_pdftest.zip
You do not have the required permissions to view the files attached to this post.
Toivo Talikka, Global Moderator

neton
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Aug 05, 2022 10:10 pm

Re: TCPDF in J4

Post by neton » Thu Aug 11, 2022 1:49 pm

Thankx but Class "Neton\Component\Zmluvy\Administrator\Controller\TCPDF" not found
I used it in my controler:
public function pdf()
{
// Import TCPDF library
jimport('tcpdf.tcpdf');

// create new PDF document
$pdfko = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
}

I think library was not loaded.
What is wrong?

lubo

neton
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Aug 05, 2022 10:10 pm

Re: TCPDF in J4

Post by neton » Sun Aug 14, 2022 3:34 pm

Hi again,
Is it right way to use 'jimport' for loading classes in extensions?
Always class not found :(

Thanks for any help.


Post Reply

Return to “Extensions for Joomla! 4.x”