Hello,
how is it possible to let the user download a .PDF which is generated out of ACF fields ?
Best
P.
Short question, but not an easy or short answer. Most of this is outside of ACF and will take you a lot of research to do, but I can give you the basic steps.
1) Create an ajax function that will generate the PDF file. You’ll need to learn how to create AJAX in WordPress and pass the post ID to the action. The best place to start is here https://codex.wordpress.org/AJAX_in_Plugins
2) Learn how to generate a PDF file using PHP. Do a search, far to complicated to go into here.
3) Getting the fields would work the same using the post ID that’s passed in your Script that generates the PDF.
Thanks! Is there also a plugin solution out there which is known to work with ACF…..something like https://wordpress.org/plugins/wp-pdf-templates/ – which creates a PDF endpoint ? Not sure if its working with ACF fields…
It appears that plugin might work, you’d probably need to create custom templates for it to use. https://wordpress.org/plugins/wp-pdf-templates/faq/ I have not seen that plugin before, I’ll have to keep it in mind.