As of now it's really hard to create a PDF Template of our Organisation (Invoice, Quotes), Column and Row arrangement and merging is the hectic thing to do? Is there any way to create those by coding or any other PDF Generator is there?
PDF Template Creation
Collapse
X
-
Tags: None
-
You have two possibilities regarding PDF (assuming you use the most recent version of espoCRM):
1. TCPDF engine. This was the enginge used a long time until version 8. If you want to use it, you need the free extension from espoCRM for TCPDF. This engine is still supported because of the many installations, that have lots of TCPDF templates. Use it only if you already have lots of templates created with this engine.
2. DOMPDF engine. This is the new engine, which now is the default engine. DOMPDF has several advantages. Use it, if you did not start anything with TCPDF.
Creating templates ist made by a template language called handlebars. In espoCRM there are integrated a lot of helpers, which make it possible - with some learning - to create quite decent templates. Once you understood the caveats of the engines and the template language, it is not so difficult to create, what you need. All fields are integrated by placeholders, be aware of using them correctly.
Some advice:
Do not use WYSIWYG mode in creating templates, it is recommended to use the code view. In most cases you will get along with HTML, in case of DOMPDF also CSS. TCPDF are created more with HTML tables. The language Handlebars provides a lot of possibilities to print out the fields, relationships, has ifThen possibilities and other stuff, that you will find in the espoCRM manual. https://docs.espocrm.com/user-guide/printing-to-pdf/
Because the templates mainly are HTML I recommend to create them in an editor and copy the result into the code view of the template. Be aware, that after saving a template, the code maybe stripped sometimes of unallowed tags. This is something to learn. The editor in espoCRM sometimes also behaves strange, so on any error or the template not looking as expected, check the code. You will need quite good HTML knowledge.
Once you created a template you may copy working code from one template to another. This often happens, when you create several templates for a company. Adress fields, all over design etc. will be identical for several templates and so you will proceed faster.
-
It's getting better:- https://github.com/espocrm/espocrm/issues/3050 (v8.3)
- https://github.com/espocrm/espocrm/issues/2952 (v8.2)
- https://github.com/espocrm/espocrm/issues/2951 (v8.2)
- https://github.com/espocrm/espocrm/issues/2949 (v8.2)
If very fancy PDF is needed, here we can face with limitations of the PDF engine.If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.Comment
Comment