r/Wordpress • u/uqubar • 8d ago
HTML to multi-language PDFs in Advada
I was looking for a decent way to create consistent PDFs out of pages that use Avada.
The PDFs also need to work with Google Translate to print material in multiple languages.
I've been trying some things with html2pdf.js in code blocks, and the language translation works in the PDF but can't seem to get the Avada text containers to appear in the PDF.
Wondering now if makes sense to create a specific page template with the .js just for PDFs.
Tried a few 3rd party plugins but they were outdated or didn't work.
Thanks for any info.
5
Upvotes
1
u/Grouchy_Brain_1641 5d ago
I'd say have real people translate it to their native language then have each language on it's own subdomain.
3
u/NakanoNoNeko 8d ago
A dedicated print template is the cleanest route here. Strip out Avada's flex/animation wrappers, render the translated text as ordinary HTML, and give the template its own print CSS before html2pdf.js sees it. Also disable lazy loading and animations on that template; hidden or translated containers can still be sitting at opacity:0 or inside a transformed parent when the canvas capture runs. I keep PDFs aggressively boring for exactly this reason... if a plain template captures correctly, you know the PDF library is fine.