Print a XYgraph into a pdf calling a custom PHP function

Hi!

Please, into the quotation module, when printing a pdf with the quotation, I would like to add a simple XYgraph.

Please, How can I call a simple PHP function inside the PDF template?

For example: can I create a XYgraph.php file and place it into /custom directory and call the function inside the PDF like this {{XYpragh}} when printing the PDF?

Please anyone can help me?
Thanks in advanced for any help!

You can try changing the file generatePdf.php or formLetterPdf.php.

Start by figuring out which of the two is relevant, and then try your changes. both are in directory modules/AOS_PDF_Templates