从表单提交输出文件生成pdf

Okay, this is driving me nuts and my deadline is tomorrow. I'm working on this very long html form and need to generate a PDF from the submitted inputs, preferably with PHP.
I have already written an HTML that formats the inputs nicely, and if possible I would just like to parse this dynamic file into some sort of PDF generator API or SOMETHING, that takes the work off me.
The thing works like this: The user enters his data into regular HTML input fields which are located in a huge <form>. The user then presses the <submit> button, which <POST>s the data to the <action.php> file.

<form id='kontakt_form' method='POST' action='app/tpl/form/action.php/' enctype='multipart/form-data'>

     <input type="submit" value="Submit">
</form>

The action.php file looks kind of like this:

<h1>13.1 Does your company have a safety program?</h1>
<?php
    echo $_POST["safetyprogram"];
?>

Etc etc. So when you press submit, you get redirected to the action.php site, where all your submitted data is presented nicely.

Now is there an easy way to just take action.php and pass it to a PDF generator api or something like that?

All of the solutions I've found required me to rewrite the whole output file, which is a huge mountain of work.

Thanks in advance