Saving PDF file to directory on server

Hi there,

Is there a simple way to save a pdf file to a directory on my server automatically ?

At the moment i use print function to save as pdf to my device.

Then i have a simple form that uploads the pdf file to a directory on my server.

is there a way to save the file to pdf and automatically upload to the directory on the server without having to pay for these software conversions ?

Help us to help you. Where does the data that you are putting/printing into the pdf file come from? Is it from the web server where you want to store the pdf file, from a different web server, or it is from an application on your local device?

ok someone has done this code for me but its not working using dompdf

require __DIR__.'/dompdf/';
require_once './controller.php';
use Dompdf\Dompdf;
if(isset($_GET["invoice_id"]) && $_GET["invoice_id"]>0){
$invoiceID = $_GET["invoice_id"];
require_once './pdf.php';
$dompdf = new Dompdf();
$output = $dompdf->output();
file_put_contents("./uploads/"."INV_".$_GET["invoice_id"].".pdf", $output);

i have a folder called uploads where the pdf is stored using prefix INV_

This is the text link to save the pdf to folder but it does not work i removed the <>

a id ="savepdf" href="/invoice/invoice.php?invoice_id=<?=$invoiceID?>" value="Save This Invoice">Save to server
Sponsor our Newsletter | Privacy Policy | Terms of Service