sayedsohail Posted September 12, 2007 Share Posted September 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/69037-solved-how-to-open-pdf-form-inside-php-and-insert-data/ Share on other sites More sharing options...
Psycho Posted September 12, 2007 Share Posted September 12, 2007 Try this article on how to merge data into a PDF: http://www.tgreer.com/fdfServe.html As for saving into another format, you didn't specify the format, but you will probably need a 3rd party, server-side tool to accomplish it. Quote Link to comment https://forums.phpfreaks.com/topic/69037-solved-how-to-open-pdf-form-inside-php-and-insert-data/#findComment-347051 Share on other sites More sharing options...
sayedsohail Posted September 12, 2007 Author Share Posted September 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/69037-solved-how-to-open-pdf-form-inside-php-and-insert-data/#findComment-347063 Share on other sites More sharing options...
Psycho Posted September 12, 2007 Share Posted September 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/69037-solved-how-to-open-pdf-form-inside-php-and-insert-data/#findComment-347108 Share on other sites More sharing options...
sayedsohail Posted September 12, 2007 Author Share Posted September 12, 2007 but the problem is how to save the pdf in jpeg or png file? Quote Link to comment https://forums.phpfreaks.com/topic/69037-solved-how-to-open-pdf-form-inside-php-and-insert-data/#findComment-347131 Share on other sites More sharing options...
Psycho Posted September 12, 2007 Share Posted September 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/69037-solved-how-to-open-pdf-form-inside-php-and-insert-data/#findComment-347303 Share on other sites More sharing options...
sayedsohail Posted September 13, 2007 Author Share Posted September 13, 2007 i will stick to the second option and it worked? thanks for the quick adivse. Quote Link to comment https://forums.phpfreaks.com/topic/69037-solved-how-to-open-pdf-form-inside-php-and-insert-data/#findComment-347698 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.