Jump to content

[SOLVED] how to open pdf form inside php and insert data.


sayedsohail

Recommended Posts

Hi everyone,

 

I got a pdf file which is a blank document, i wish to use this pdf form and insert some data and than save this form as something else.

 

 

My pdf form has got some titles i.e,

 

Name                    Date

I wish to insert data from my table under the relevant title and than save this form as something else.

 

 

Reading                Issuing Signature

 

 

 

Address:

 

 

Can someone advise how to achieve this functionality.

 

 

Thanks for reading.

 

 

Link to comment
Share on other sites

Thanks, i just wanted to use the pdf form template and insert some data using mysql. than save this pdf template to new file in pdf format only.

 

At the moment i am using ezPDF by ross to create new pdf documents, but i am not sure how to open existing pdf file and insert data and than save this file as new pdf document.

Link to comment
Share on other sites

I am not familiar with ezPDF, but I have a good deal of experience in creating dynamically generated PDF documents through a web interface and PostScript programming.

 

In order to add data to an existing PDF you will need to take one of two approaches:

 

1. The template PDF must be set up with form fields in order to recieve the variable data. The article I linked to explains that process. However, you would then need to save that new PDF. Saving the new PDF with the data in the form fields should be relatively simple, but they would most likely still be form fields - i.e. when opened the usre could edit those fields. Saving the new PDF such that the data cannot be manipulated may be considerable more difficult.

 

2. Use the "template" as a background and superimpose the variable text on top of the template. However, using a PDF file as the template would not be my preferred approach and would not be feasible in many situations. I would suggest saving the template PDF as images in a format that ezPDF can work with. Then when you need to create a PDF with the variable data, load the template image as a background and then place the text at the appropriate coordinates.

 

I suggest going with #2.

 

For more help on this I would suggest you post your question on this forum: http://www.tgreer.com/printforum/

 

It is not a very active forum in the number of posts. But the moderator and another frequent responder are very knowledgeable in this area.

Link to comment
Share on other sites

but the problem is how to save the pdf in jpeg or png file?

 

At the moment i am using ezPDF by ross to create new pdf documents, but i am not sure how to open existing pdf file and insert data and than save this file as new pdf document.

 

Ok, you see my confusion? LOL.

 

You will need a 3rd party server-side tool. Here is one possibility from a quick Google search. I'm sure there are others.

 

But, you are starting with a PDF Template and then adding text. If you can instead use image based templates then you could make the new images using the GD library functions in PHP. But, if you are receiving the templates in an automated process then you are still back to the requirement of a 3rd party tool.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.