I Have just started to learn PHP. As a task,
I submitted a form which sent the values to the MySQL database, Now, I want to fetch these values from the database and display it in a letterhead format and then have to output that letterhead as a PDF file.
Please suggest me a way to do that from the basic level, I tried to follow 1-2 questions here but couldnt get any results. I need a step-by-step procedure...
Thanks in advance!
Your work can't be done by us. so please search and research again. PHP itself provides a good way to generate pdf. If you don't like it you can go for a library such as fpdf.
You should google it first. try some code. Then you will get most errors. If you can't find a solution for that errors. You can post a question seeking help. We can help you.
Here is the link for Php pdf documentation
Here is the link for fpdf php library website
Related
ok so the thing is i need to create charts and i found canvas js, which looks promising, problem is i have the website on php and i dont know how to give data to the charts from php to jquery to charts, basically how to feed it from mysqli database and php with jquery.
i didnt find any explanation on the main website and its chatbot want my number straight away so no use.
this is my 2nd question so if this is not the right question to ask without any code, i am sorry, ill take care of it in the future. but i dont have any code cause i dont know where to start. with php to fetch data. and feed it to the chart through jquery.
Code-Samples for rendering chart with data from datababse is readily available in CanvasJS gallery section. You can even download working sample from download page, which you can run in your local machine directly.
If you still unable to make it work or facing issue, share the code with brief of the issue you are facing so that the community can help you!
I've been looking for creating a pdf using php without using a library but when I was looking on google for this I am not being able find any information how a pdf is made within php. Now I know the simple answer is 'Look at the code of an existing library'. But this does not give me much detail and how/why certain lines of codes are being used and what is or what isn't bad practice.
I hope, any of you have some prior experience with this and can help me out.
I need some library or good documentation of xlsx files for writing out xls files from website. all I need to do is fill in content into predefined and styled table. I have considered writing everything directly from php but could't get hang of merging cells and if I could it would be a hell writing code for changing any style into a document instead its much better if I have predefined file uploaded and then just fill in.
Please redirect me or help me find some proper documentation.
Project is in early stage and can consider switching to other language like Node.js if it makes this part super easy but trying to keep it low profile prefer using PHP so i'm open to all ideas.
Thanks in advance to everyone.
PS. this is my first question on stackoverflow
Kindly do a Google search before posting questions like this. But answering your question, PHPExcel is a nice place to start. Just go through their documentation.
I have written an app for an ipad that once used sends data to an sql server. I can access this data using a web page, currently using php but this is not fixed, and I would like to be able to then click a button on the web page and generate a pdf report from the data in the sql database.
I am not really sure where to start looking so any pointers much appreciated.
There are lot of libraries available.
http://www.fpdf.org/
https://github.com/dompdf/dompdf
Google it you can get lot more. Personally i have used fpdf.Its little bit difficult to implement but flexible.
You should retrieve de data you want to show from de database first and then create the .pdf file using a class like FPDF (http://www.fpdf.org/) or similar. *You can easily find it in google.
You wish to generate a PDF, you got some options:
http://php.net/manual/en/book.pdf.php Never used this
http://www.fpdf.org/ I used this one myself, works nice :)
And probably you'll be able to find loads more if you Google search for "PHP PDF library"
I am displaying all the users in the form using php where the data are fetched from db.
When i click on the icon all users data should be show in a pdf with a good table structure.
i am hereby using fpdf to generate it. i created pdf but the records are not in formatted structure.
How should this can be done.
kindly advice.
thanks in advance
strong text
Please try to put the full code which you are using to create the PDF, using fpdf.
I would also recommend that you please try using the DOMPDF library, as I used it myself several times & had no such problem with table structuring.
Maybe the HTML part of the PDF code is not correct, so please put the code in your question.
This can be done only by using dompdf. Here is the link.
http://www.digitaljunkies.ca/dompdf/examples.php#demo
and i got the exact output what i need.
thanks for all