DEV Community


Discussion on: What tools do you use for server side PDF generation?

tux0r profile image

Use a Word or OpenDocument template (or another of your choice). Use LibreOffice in headless mode to search and replace the fields (you can use ###VAR1### or whatever you like) in your document by the generated values. Then convert it:

libreoffice --headless --convert-to pdf your-document.docx
Enter fullscreen mode Exit fullscreen mode

That should do.

christianca profile image
Christian Córdoba Author

Well that approach looks interesting too. We'll look into it, thanks :)

justinemailone profile image

Great suggestion. Looking into it lead me to pyoo which seems to be the best way to go for my use case.

pyoo link:

Related article:

Another similar library that might be useful: