Forums

TCPDF draw lines, shapes etc where

gix.vax 28 Feb, 2023
HI
I need to draw rectangle on a pdf

can i put php code in Content of TCPDF function?
If yes, how i can refer to pdf to draw shapes?

eg.
if i use pure php i write something like this
// Include the main TCPDF library (search for installation path).
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// Rect
$pdf->Text(100, 4, 'Rectangle examples');
$pdf->Rect(100, 10, 40, 20, 'DF', $style4, array(220, 220, 200));
$pdf->Rect(145, 10, 40, 20, 'D', array('all' => $style3));



If i use tcpdf "from scratch" i can refer to $pdf object but how in in chronoforms/connectivity ?
Can i refer to "$pdf" ??
Or i have to made pdf from scratch and call tcpdf etc?
Elita- 13 Mar, 2023
Hi, gix.vax,
you can use HTML to create your PDF output. just have to remember that only some of the features (html tags, css properties) work for the PDF and you should mix them together to have desired output.
For me it was try and trial method for what works and what not and some readings on the internet.
gix.vax 13 Mar, 2023
Thank you Elitakey

I understand that if i have a deep use of "$pdf" i have to use TCPDF directly whit custom CODE

for now, for rectangle i use a trick using border in table
Max_admin 23 Mar, 2023
Answer
You will need to load the TCPDF class then use your own code, you may check the TCPDF action source code for how to do this.

Then you may create your own action which you can install later using the "Extend" page.
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
gix.vax 23 Mar, 2023
Then you may create your own action which you can install later using the "Extend" page.

With "Extend" you mean "Install features" ?


I created an external php that call TCPD
In this php i have a function with a lot of parameters (size margins, html code to show, print_yes_no, path. filename, etc)
In a custom code i call it passing parameters .
So i can use it in a loop (passing mysql values for example) or standalone and choose if show pdf inline on screen, print or send by email etc.
Max_admin 01 Apr, 2023
No, it's called "Extend" in v7
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
You need to login to be able to post a reply.