PDF templates / need A5 page size / how to create user defined page size

Hi,

the default installation of suitecrm (cur. ver. 7.10.10) supports PDF-templates for A4, Letter and Legal.
Is it possibly to create PDF-templates with another page size?

I need, for instance, A5 page for a special form, but don’t fond information, how I can do it.
Please help, if you know the way.

Thanks in advance
fram

1 Like

Hi folks,

the creation of PDF-templates supports per default only a few page sizes (letter, legal and A4).
However, the list of supported page sizes can be easily extended by editing the dropdown list “pdf_page_size_dom” via “Dropdown Editor”.

There is a large list of formats available, which you can refer to via the function “_getPageFormat” in “modules/AOS_PDF_Templates/PDF_Lib/mpdf.php”.

If you need a special format, the list can be extended by adding a new line to the function mentioned above, e.g.:
case ‘MYSPECIALFORMAT’: {$format = array(396.85,595.28); break;}

HINT: The case label (format definition) must be uppercase!

So, this is it…

enjoy this tip

2 Likes

Thanks for the tip, this can be useful for others.

Do you think it would be a good idea to add some more formats into the core code? Can you provide a PR, or at least a list of code changes that would be required?

The information is not clear, I have tried one day to do it, so I dont know where I should go to add the line in the dropdown

I don’t know, i never tried this but I am guessing you need to add the value to the Dropdown in Admin / Dropdown editor, and then go in the file

modules/AOS_PDF_Templates/PDF_Lib/mpdf.php

search for the _getPageFormat function, where there are a bunch of formats already defined, and add your own.