ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

TCPDF draw lines, shapes etc where

G
gix.vax posted Feb 28, 2023 at 16:15
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?
E
Elita posted Mar 13, 2023 at 09:55
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.
G
gix.vax posted Mar 13, 2023 at 16:14
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 posted Mar 23, 2023 at 15:22
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 ?
G
gix.vax posted Mar 23, 2023 at 20:53
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 posted Apr 1, 2023 at 12:15
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.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com