Reputation: 2615
I am building a website where I need to put some content from that into a PDF file for people to print for example.
So let's say on my website you can create teams for a competition (just an example). So I would go onto the website an you can then write in an input field how many teams there should be (let's say 3), and how many people in total there should be (let's say 30). So on the next I can then distribute these people into the teams, so for example "Team 1" has 10 people, "Team 2" has 8 people, and "Team 3" has 12 people. And on the last page I can write the names of the different team members.
So in principle this would be a table with 3 columns, and then 10, 8, and 12 rows.
I now wish to somewhat put that onto a PDF with nothing of the formatting from the website, but like a PDF template, where these tables then are inserted. So for example I have created this in Word just to visualize what I would like the output to be. But of course, this is nothing like it would look on the website, since that would be formatted differently.
Can this even be done, or do I have to think of another clever way to do it ? Like pre-made PDF files where I have taken most combinations into account fx, or...?
Upvotes: 1
Views: 27
Reputation: 1741
You can use a download button that links to an html page where only the table is display an add the attribute download
to the button to tell the browser not to open the html page but to download it. you can also specify supported extensions like html
, php
, js
, pdf
and so on.
<a href="/path/to/table.html" download="table.pdf">Download table as Pdf</a>
Upvotes: 1