Save generated pdf file into server

The user creates a pdf from the form pdf button and by default that file is downloaded into the browser. We have a need to store the file in that operation also to some specific location into server for archive/reference purpose. It will be linked to the form concept. I can't find any means to achieve this. Any ideas or tips?
 
Not really, no. It's probably possible, but not with anything currently in the Fabrik toolbox. It'd need some custom coding.

-- hugh
 
Yes , I realize that. Can u give us some hints where to put the "custom coding"? in view.pdf.php? Is the pdf output available somewhere?
 
For now we "accept" that the pdf is downloaded and then we drop it into a document form field to be uploaded. We want the file to be stored into document field directly .
 
I should have been more specific. I have no idea how to do this, without coding it into the pdf view directly, ie modifying core code.

Sent from my HTC One using Tapatalk
 
I?m interested in this kind of functionality too. searching on google I?ve found this

Automatically Saving a dynamic PDF to the remote server using DOMPDF
You can do one thing like below which i am doing for my application. First create a folder in your server under the root directory for example. Then change read write permissions to that folder using chmod command.

Then get all the code in $html string.

$dompdf->load_html($html);
$dompdf->render();
$pdf = $dompdf->output();
$file_location = $_SERVER['DOCUMENT_ROOT']."app_folder_name/pdfReports/".$pdf_name.".pdf";
file_put_contents($file_location,$pdf);
Where pdfReports is the folder which i created to save all the pdf's. You can change to your folder name.

I don?t know to perform the changes needed to include that code in /libraries/dompdf/dompdf.php, any idea?
 
Last edited:
You'd have to do it in our PDF renderer, in ./libraries/joomla/document/pdf/pdf.php, around line 157 where we currently stream() the doc to the browser. But as you'd be modifying core code, you'd have to either re-apply your changes after every update, or maintain your own fork of Fabrik.

This is potentially something that could be added as a global option, something like "archive PDF's", if someone wants to do the work and submit a PR on github.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top