So I am given a task to make this possible it if it. We have a website where there are forms available for grabs and print. Now the supervisor wants it if its possible that the agents when grabbing the form, doesn't need to print the form. But just fill up from there and submit the form thru PDF again with details already in it. Is this possible with PHP?. I am attaching on of the forms.
https://docs.google.com/file/d/0B3yAPZizyWCCYWkwWHdrdzBBdFU/edit?usp=sharing
Why would you need to use PHP at all? You can make editable pdf forms. I've downloaded the attached form and, unfortunately, this is not already editable but reconverting them to editable PDF is easy. The most common solution to convert standard pdf to editable pdf forms is acrobat: the guide to do so is here. However, you may find some free or ad-supported services which allow you to do the same thing on the internet. With some googling I've found pdfescape.com. Try to create a new document in pdfescape.com and, under the "insert" menu, choose "Form Field". That's it: you've just added an editable field to your page. Now click the "Save and Download" icon.
Once you've done with converting your pdf document from static to editable, you can distribute the pdfs to the agents and they can compile and save the form with free programs. On Mac OSX I can do that with the default image viewer. On Windows you'd probably need Acrobat. Still, they'll be able to download the pdf, compile the form, save and submit back the compiled form.
If you really want to do this with PHP, have a look at the documentation and try to figure out yourself how much time such a task would require, considering you should tell PHP where exactly to write text (in pixels) on the form and handling all exceptions (such as too long text) yourself. Here.
Also, doing that in PHP would require you to parse the pdf file into php and THEN create a new pdf out of it. Good luck doing that!
This is definitely possible. You'll have to be careful about the security (since you're passing tax ids), and you'll need to let the users know that they'll have to use Adobe Acrobat Reader to submit their completed form.
On the form itself use Adobe Acrobat Pro to create custom form fields.
Set the document to allow saving in Acrobat Reader
Create a button in Acrobat Pro on the document to submit the entire PDF as a PDF file to your server. Here's a link explaining how.
On the server where you want the PDF to go, then you would install a trusted certificate from a CA. This should allow transmission through SSL from Acrobat.
Additionally once the user has completed their form you can supply a link where they can upload the form through SSL (if they don't want to use Acrobat to complete the fields). (An example might be someone printing out the file to sign it.)
You can also set the file up to send as an HTML post as well. You would need to work out the legal aspects of using a signature for this though.
Remember that e-mail is not secure, so having users submit a completed form through e-mail could compromise their identity.
1)if i open the pdf form in browser ,am not able to get the post of pdf form in my phpscript
2) if i open the form in adobe acrobat then am getting the post in $_POST variable..
below is the my php script..
According to me $_POST varibale is not working when opening the form in web browser..
<?php
include "connection.php";
echo '<pre>'; print_r($_POST); echo '</pre>';
$sql = "INSERT INTO persons (name, city, state, country)VALUES('".$_POST["name"]."','".$_POST["city"]."','".$_POST["state"]."','".$_POST["country"]."')";
if($conn->query($sql) === TRUE)
{
echo "New record created successfully";
}else
{
echo "Error: " . $sql . "<br>" . $conn->error;
}
?>
Related
I want to provide a PDF with a form on my Website. It is integrated with an iFrame. When the user has filled it out, it should be save with the user fillings (not empty) on a directory of my Webspace. Is there an elegant solution to this possibly using PHP? Thanks.
No.
Because you can't control what browser is used, you can't control what PDF viewer is used to fill the form. Some embedded PDF viewers won't even be capable of filling form fields. My recommendation is to collect the data using standard HTML, then populating the form using any one of the several PHP libraries that can populate PDF forms, then present that to the user and have them sort of "approve" it, at that point, you save it to your Webspace.
That said, there are solutions like Adobe Sign that will convert the PDF to and HTML5 rendition that allows you to fill the form in any browser then retrieve the data and/or a static PDF for storage on your Webspace.
I'm working on a project a little special and I have to insert an excel form on a web page so that users can fill it online and then on submit it have to be sent by email (as attachment or form) to the recipient of the form.
The company has no skydrive and the form must be an excel and not an HTML form.
Does anyone have an idea?
Thanks all !
I'm the creator of Appizy (http://appizy.com) that aims at converting Excel files into dynamic webapp. If I get it well you could generate your HTML form based on Excel Spreadsheet with Appizy.
Then you "just" need to plug a submit button to the generated webapp to send the data by email.
PHPExcel seems to offer a fully fledged engine for PHP (including calculating ability).
There doesn't seem to be any clear cut examples of how to interact with it via a webpage however.
I have some report that is generated from a form. I need this form to be saved automatically on the server, on submitting. Is there any way to do it?
I tried researching on the subject, but Google just throws up links where the user gotta input the URL and press submit or such method. As this pdf should be generated and saved automatically after every form submission, I guess the preferable method would be to call a service or such to generate the PDF and then save it on the server. Can you plz give me a walk-through.Thanks in Advance.
I'm working in PHP.
Here is the pdf docs from php.net. It's all there for the taking. Good luck!
PDF - Manual
I am about to embark on the same journey as I need to create a script to turn a document into a .pdf file using PHP. I don't know a lot about it yet, but it does seem possible. Try this link for starters...
http://www.sitepoint.com/generate-pdfs-php/
Chrome allows users to hit Ctrl + P and choose 'Save to PDF'.
Is it possible to have this function through an html button?
I want the user to just hit a button and go directly to the Save as PDF prompt ( where the file name is set by PHP and not automatically by Chrome ). So the user basically just hits the button and clicks on Save on the prompt window.
Is this possible?
Can I skip the previous steps?
Nope, it's not possible.
But, you can give the user the choice to download a HTML file output as a PDF file. There are a few libraries around, Prince is the best but expensive, so check out DOMPDF.
By the time your user can hit ctrl+P in the browse, the PHP process that generated the page (on server) is already closed.
Besides the fact that PHP exerts no direct control over browsers. It just sends them information in the form of HTML/CSS and important in this case JavaScript.
With JavaScript you could trigger the normal print behaviour of the browser but you would have no control over it.
Another approach could be to generate the PDF on server and send it as a file to the browser. In which case the browser will either ask the user if he wants to open it or it will ask the user if he wants to download it.
I've personally used fPDF to customise the PDF invoices of various open source e-commerce software. Like for example PrestaShop.
All you really need to do is download the library from (fPDF](http://www.fpdf.org/), but seeing it in action and being able to change/adapt a working version might help you so you could look for the PDF invoice in a fresh the PrestaShop install inside the folder classes the file name is PDF.php .
I lost several hours trying to make conversion to pdf on the server with no luck because my view contains some jquery functions that do the main rendering. I thought of providing a button to save as pdf using the browser but then opted to using javascript on the client side to do the rendering to pdf. This may not be the optimal solution in certain cases but looked the most sensible one in my case.
there are many libraries I just started using html2pdf.js and it is working fine so far.
I have a classifieds website, and when posting a new ad, users may chose to upload pictures.
Currently, the form on the page submits to itself whenever a file is chosen, and then PHP uploads the actual file, which is then lastly displayed to the user.
I use javascript to set some hidden-inputs on the page, and then submit the form to itself:
if (action!='remove'){
document.getElementById("pic_nr").value=nr;
document.getElementById("total_pics").value=nr;
document.getElementById("pic_action").value='upload';
var form = document.forms['ad'];
form.action='new_ad.php';
form.submit();
}
Then in PHP, it processes and uploads the image (which takes some time) and after its done the image is displayed in the same form.
Now I need to have a progress bar of some kind, which shows the user that the server is actually DOING something.
Because uploading a standard 2,5MB file from a digital-camera takes some time (around 10s), and usually the user doesn't understand that "something is happening" in the background.
Is there any standard reliable, cross-browser solution to add a loading bar with either JS or PHP, or even maybe both combined?
Any tips and ideas are appreciated.
Thanks
This site seems to have a pretty comprehensive list of tutorials with various approaches. JQuery to me would seem to be the best option to go with as it usually is pretty reliable between browsers and platforms.
you could POST the form using AJAX and on firing the form POST load a "loading" spinner on the page until you get a postback with a status from the server.
I'm adding a link to a sample HTML5 script that does it with drag-n-drop...
http://craigslist.fatherstorm.com/dragndrop.php