Reputation: 165
I need some help. I'm searching for almost 2 days but I can't find the perfect answer. so I have a HTML form when I submit the click button it saves data in the database now I need to generate a pdf of my HTML form when data is submitted and automatically mail it to my email address. I need to generate pdf file without using any tool or any other demo like FPDF
or anything like that.
I want to generate pdf using PHP code. can it be done? need your help.
thankyou!!!'
<form action="dbconnection.php" method="post" name="2nd-form" id="form-survey" >
Upvotes: 1
Views: 1168
Reputation: 2296
No you can't create pdf without any library. another good way or my suggestion is you can create a html body using the form content . Then add this as html-content in your mail .
I think this is the easy way to avoid time consuming to create PDF and attach it to mail and send it all.
Try to use this way or if you want the pdf for some purpose so you should use some library to create it.
Upvotes: 0
Reputation: 318
If it's just saving the code why don't you just save it as a .txt file, attach that, and save yourself all the hassle. PDF creation is possible but extremely over complicated for simple task without the use of a library of some kind. Writing to txt file is super simple and much easier to maintain that a ton of PHP code. If you do end up using a library look into mpdf. Is much better than fpdf. It has better documentation too.
Upvotes: 2