Madhup Singh Yadav
Madhup Singh Yadav

Reputation: 8114

Insert data into PDF, filled in an online form, on submit action

First of all my apologies to all the people who think this question is a repeated one or they find a similar question to this.

I am working on a project in which I have an online form and some PDFs stored on the server.

Functionality

On the submit action I have to get the data from the form, fill it to the copy of PDF and finally download it.

Approach

I followed these steps to achieve this functionality:

Problem

I need to to automate this process. What I have found through searching is I should create an FDF file that contains my variable and pass it to the PDF using some library and then download it.

I am able to create the FDF file but missing any library in PHP (I found one in JAVA) that I can use to create the PDF and download it. One library that I found is pdf tool kit but that is a command line tool and I am not able to use it on the server at run time and download the PDF file.

Anybody having done this before please help.

(Sorry for this long post)

Thanks,

Madhup

Upvotes: 2

Views: 7620

Answers (1)

timdev
timdev

Reputation: 62874

Check out FPDI. It allows you to load some existing PDF, draw on it programatically, and output a new PDF. Which, if I read your question right, is what you're trying to do.

There's some example code here.

Upvotes: 2

Related Questions