0

I'm just wondering about a small problem I have. I'm creating a simple website with PHP, HTML and CSS. The user enters the dimensions of a rectangle into a form, and this all works perfectly. However, I'm unsure how to proceed.

The system should then use these dimensions (both stored as separate variables) to draw a rectangle of that size (in cm). The rectangle should be draw in a .pdf document, which the user can then download.

I'm a beginner, so sorry if there's anything wrong with this question.

2 Answers2

0

You're going to want to start with looking into the html5 canvas element for drawing. There's plenty of tutorials online for you. As far as saving to pdf, see this: Convert canvas to PDF good luck.

Community
  • 1
  • 1
ntj
  • 41
  • 3
0

Take a look at the fpdf extension available for php. Or even better and more consequent: use its unicode capable variant 'tfpdf'.

It allows you to generate a pdf document on the server side in a step by step way. You can control all details of that document. When finished you can return the document to the requesting client.

arkascha
  • 41,620
  • 7
  • 58
  • 90