Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Im looking to create a new PDF in PHP, given a PDF form template and some PHP variables to input into the PDF template. Whats the best or recommended way of tackling this? Essentially the end goal is that users will fill out this pdf form and there inputs will be saved to a database. Then later being able retrieve the inputs from the database and outputting it to the PDF. Any help with this would be great, Thanks.
You can use a command line tool called pdftk (PDF Toolkit).
See https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
You can call the command line from php, and the command is
pdftk formfile.pdf fill_form fieldinfo.fdf output outputfile.pdf flatten
You will need to find the format of an FDF file in order to generate the info to fill in the fields.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
im new in Webdevelopment and I wanted to ask you ("THE EXPERTS") if you could guide me or give some hints how to do following Webpage:
I want to upload 3-5 Images, place them automatically horizontally on a PDF and let the user download the PDF. I don't want to store the images so after you reload the page the images should be gone.
Could you help me how to realize such webpage? Or atleast which way I should use? Jscript, html5, php etc...
Best regards
Machete
You are looking for a pdf-libary like FPDF.
Especially take a look at the Image() function (Documentation).
quick and dirty, create a php script that executes something like this on the shell:
convert image1.png image2.png image3.png output.pdf
you need to have imagemagick installed.
There are more elegant ways to do that.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I want to print mysql database value in tabular format in PDF using php and I want to include header and footer as well on every page of PDF. The problem I face is every last row of the table in PDF is breaks and displays into two parts and the footer is display on another page. So is there any way to stop breaking of a table row which is just above the footer division and print it on another page???
My another question is if I want to give more than one page size in pdf then how can I do it???
You can use any of the below php scripts to generate dynamic PDF documents
FPDF
TCPDF
MPDF
DOMPDF
I have answered it by searching multiple previous stackoverflow answers. You can see them here Link1, Link2,..
You can use tcpdf http://www.tcpdf.org/ for this check the examples here http://www.tcpdf.org/examples.php . All the features required by you are available in this library
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to send the doc and pdf file to the MySQL database using php from my android application.
I have no idea about it. What shoud i write in android and php file?
Please guide me if anyone have code?
Thanking you.
You have two options:
1) Store it in a field with a BLOB data type. I really do not advise this in any way and is only listed as the first option because it pertains directly to your question.
SO has good coverage of this already Storing files in SQL Server
2) Move the file to a folder and store the file path. This is the preferred option by mmmm everyone. Use move_uploaded_file and if you are unsure of how to setup an html form take a look at W3C PHP File Upload
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
To generate pdf file from html page I have used libraries like MPDF , FPDF, DOMPDF etc.
In each pdf library I found following issues.
mpdf causes unnecessary page breaks
FPDF needs more writting. etc
When I used DOMPDF it worked fine but large table didn't expanded to next page and pdf broke without generating next pages.
Then I searched for another pdf library and I came to know about TCPDF.
SO I want to know what are the disadvantages of "TCPDF"?
A great alternative for PDF generation is wkhtmltopdf. It has a smooth integration and the result is awesome. You will have to install the binary into your server, though. If you're on a VPS or dedicated, this will not be a problem.
There's a PHP lib for using it, you can find it here: https://github.com/KnpLabs/snappy
Also, there's a nice solution for the large table problem you have. Maybe it can help you with another lib too, take a look here: https://code.google.com/p/wkhtmltopdf/issues/detail?id=566
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to create a form inside a PHP file that will allow me to type in a couple text fields and then upload those fields to certain tables/columns in my database. I can figure this out, but another option I want is to upload a song and upload an image to my webserver and then retrieve the link and upload those links to the database..
Does anyone know of a good tutorial for this?
You can find information on the php page.
Here is the link for upolading files information.
http://php.net/manual/en/features.file-upload.php