Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to overgive a template to a dompdf script?
    primarykey
    data
    text
    <p>i wanted to ask, what would be the best way, to generate a dynamical pdf?</p> <p>My Script generates a template from a predefined HTML code and replace the values with my current ones.</p> <p>The Problem now, how do i get this information to my dompdf script? The idea is,that someone should klick on a button and can download the generated PDF.(it's not a big deal)</p> <p>In an Example I found a solution, that someone has use a $_SESSION-Variable.</p> <pre><code>&lt;?php require_once("dompdf/dompdf_config.inc.php"); $dompdf = new DOMPDF(); date_default_timezone_set('Asia/Manila'); $tym = date('g:i s'); $filename = 'print'.$tym; $dompdf-&gt;load_html($_SESSION['prints']['table']); $dompdf-&gt;render(); $dompdf-&gt;stream($filename. ".pdf", array("Attachment" =&gt; 0)); ?&gt; </code></pre> <p><a href="http://kyokasuigetsu25.wordpress.com/2011/07/14/how-to-use-dompdf-with-css/" rel="nofollow">here</a></p> <p>But i don't think this wouldn't be a very good solution, because my table could be between 100 and 300 rows.</p> <p>The Second solution my friend has suggest,was to save the html in a MysqlTable and save also a sessionID and timestamp for this user, so that i don't have collisions and could identified him. When the entry was 1 hour old i should delete it.</p> <p>Has someone a better solution?</p> <p>Edit: Now i have a 3rd Solution, I think it's better then the 2 before.</p> <p>How would it be, that I save the HTML-Template in an extern file and will save in the DB the place where the file exists. When it is 1 hour old i will delete it on the same request and recreate it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload