Home > Back-end >  Create PDF based on database with formating
Create PDF based on database with formating

Time:06-25

I work on a project where I automate the creation of a menu for the cantine in my school (a pdf that looks like this https://lem.lu/pdf/menu/220620 menu.pdf) and I dont know how to create a pdf web based with template.

Currently I have the website where you can enter the menu and one where you can edit it. So now I have to create a PDF with the data from the database but i dont know how. I imagine a service/tool where I can insert data automatically, after some event on the website (p.ex xml file) into a template and get the pdf from that. Is there something like this out there?

I know Indesign server exists but it is too expensive.

Before I had a python script that took a word document with the menu, created an xml file, imported it into indesign and then exported as pdf.

I use a MySql database, and the two sites are written in hmtl/php

CodePudding user response:

you can use PHP for creating a PDF File. https://github.com/heimrichhannot/pdf-creator

Just write a HTML how it should look like, then convert it to an PDF. I often use Dompdf.

If you have questions in implementation, give a message.

  • Related