Agregada instruccion para reiniciar tablas de horarios.
[CLab.git] / include / dompdf / www / examples.php
blob961638272c18cf135bc9f26098dcf951bc4c5094
1 <?php
2 require_once("../dompdf_config.inc.php");
3 if ( isset( $_POST["html"] ) ) {
5 if ( get_magic_quotes_gpc() )
6 $_POST["html"] = stripslashes($_POST["html"]);
8 $old_limit = ini_set("memory_limit", "16M");
10 $dompdf = new DOMPDF();
11 $dompdf->load_html($_POST["html"]);
12 $dompdf->set_paper($_POST["paper"], $_POST["orientation"]);
13 $dompdf->render();
15 $dompdf->stream("dompdf_out.pdf");
17 exit(0);
21 <?php include("head.inc"); ?>
22 <div id="toc">
23 <h2>On this page:</h2>
24 <ul>
25 <?php echo li_arrow() ?><a href="#samples">Samples</a></li>
26 <?php echo li_arrow() ?><a href="#demo">Demo</a></li>
27 </ul>
28 </div>
30 <a name="samples"> </a>
31 <h2>Samples</h2>
33 <p>Below are some sample files. The PDF version is generated on the fly by dompdf. (The source HTML &amp; CSS for
34 these files is included in the test/ directory of the distribution
35 package.)</p>
37 <ul class="samples">
38 <?php
39 $test_files = glob(dirname(__FILE__) . "/test/*.{html,php}", GLOB_BRACE);
40 $dompdf = dirname(dirname($_SERVER["PHP_SELF"])) . "/dompdf.php?base_path=" . rawurlencode("www/test/");
41 foreach ( $test_files as $file ) {
42 $file = basename($file);
43 $arrow = "images/arrow_0" . rand(1, 6) . ".gif";
44 echo "<li style=\"list-style-image: url('$arrow');\">\n";
45 echo $file;
46 echo " [<a class=\"button\" target=\"blank\" href=\"test/$file\">HTML</a>] [<a class=\"button\" href=\"$dompdf&input_file=" . rawurlencode("www/test/$file") . "\">PDF</a>]\n";
47 echo "</li>\n";
50 </ul>
52 <a name="demo"> </a>
53 <h2>Demo</h2>
54 <p>Enter your html snippet in the text box below to see it rendered as a
55 PDF: (Note by default, remote stylesheets, images &amp; are disabled.)</p>
57 <form action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
58 <div>
59 <p>Paper size and orientaion:
60 <select name="paper">
61 <?php
62 foreach ( array_keys(CPDF_Adapter::$PAPER_SIZES) as $size )
63 echo "<option ". ($size == "letter" ? "selected " : "" ) . "value=\"$size\">$size</option>\n";
65 </select>
66 <select name="orientation">
67 <option value="portrait">portrait</option>
68 <option value="landscape">landscape</option>
69 </select>
70 </p>
72 <textarea name="html" cols="60" rows="20">
73 &lt;html&gt;
74 &lt;head&gt;
75 &lt;style&gt;
77 /* Type some style rules here */
79 &lt;/style&gt;
80 &lt;/head&gt;
82 &lt;body&gt;
84 &lt;!-- Type some HTML here --&gt;
86 &lt;/body&gt;
87 &lt;/html&gt;
88 </textarea>
90 <div style="text-align: center; margin-top: 1em;">
91 <input type="submit" name="submit" value="submit"/>
92 </div>
93 </div>
94 </form>
95 <p style="font-size: 0.65em; text-align: center;">(Note: if you use a KHTML
96 based browser and are having difficulties loading the sample output, try
97 saving it to a file first.)</p>
99 <?php include("foot.inc"); ?>