How to dump PHP and HTML data on JPG Image (Fill FORM)

0

I would appreciate it if you could indicate how to fill out a form (contained in a JPG image, by theme of presentation) through PHP

The need is to fill out a pre-established form (.JPG) and generate a PDF, containing the form filled with data obtained by calculations of the program

Here is an easy library to create PDF's, fpdm ( link ) but every time I generate a PDF template with fields (Adobe Acrobat) PHP does not recognize it and apparently it is a condition to buy your pdftk application (for payment), so it occurred to me to "format" the data on a JPG containing the empty form. I would appreciate to propose another more viable and practical solution

    
asked by Ignarous 16.07.2017 в 06:10
source

2 answers

0

The most viable and practical solution is to show the form in normal and current HTML. Once the form has been sent and processed, a link to download it, already filled, can be displayed in PDF.

Learn HTML and CSS to make it look as similar to the original PDF form. It's not that complicated.

Another option, less viable and practical, is to show in the previous form:

  • A link to download the form in PDF. The PDF file must be one of the ones that allow you to fill in the fields and save it with the new data.
  • A button to upload the already filled PDF. You will have to create PHP code to read it, possibly pulling a library that allows you to extract the value of the fields (I do not know if pdftk allows to do it or not).
answered by 17.07.2017 в 14:07
0

the ideal would be something similar to what @jotaelesalinas says: the recommendation is as follows: present a table with inputs and background you put the image.

you send everything to the server and server side you recreate the same structure, table with background image, but the inputs you receive convert them into labels. by result, convert the structure to the PDF output and you will have your PDF with form data ready to print.

I do not know if php / PDF Libraries can recreate a PDF with embedded Inputs that is what I think you are looking for.

    
answered by 17.07.2017 в 16:42