Interesting, I've never thought about that; do you mean in the details page or in the results page?
For the details page, the button has to redirect to an URL like this (change tablename, where_field and where_value according to yours):
index.php?tablename=customers&function=details&export_to_pdf=1&where_field=id_customer&where_value=301
the problem is that the function export_to_pdf expects in POST the name of the template:
$_POST["pdf_template"]
so you should, using some javascript in your function, post the value to the URL.
I might add to the next version the possibility to specify the template via GET, which would make the whole think easier.
A possible (not tested) "hack" is to pass it anyway via GET
index.php?tablename=customers&function=details&export_to_pdf=1&where_field=id_customer&where_value=301&pdf_template=mytemplate
and then, in your custom_startup_function (see custom_functions.php), add something like:
if (isset($_GET['pdf_template'])){
$_POST['pdf_template'] = $_GET['pdf_template'];
}
be aware that if you use "pdf_template" as a field name somewhere in your db, you can have unexpected results.
Best,