You will need to develop the PDF template in HTML, then save it to PDF.
There is a plug-in for the wysiwyg editor Tinymce that converts html to a pdf
https://www.api2pdf.com/tinymce-save-to-pdf-plugin/
This is a basic example of how to use it
<!DOCTYPE html>
<html>
<head>
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
<script>
tinymce.init({
selector: 'textarea',
external_plugins:
{
'saveToPdf': 'https://cdn.rawgit.com/Api2Pdf/api2pdf.tinymce/master/save-to-pdf/dist/save-to-pdf/plugin.js'
},
toolbar: 'saveToPdf',
saveToPdfHandler: '/REPLACE-WITH-HANDLER-URL'
});
</script>
</head>
<body>
<textarea>Testing saveToPdf</textarea>
</body>
</html>
Thank you very much Erlon, you really helped.
– Sérgio Avilla