admin
doz
html2pdf_v4.03
_class
_tcpdf_5.0.002
examples
res
about.php
bookmark.php
exemple00.php
exemple01.php
exemple02.php
exemple03.php
exemple04.php
exemple05.php
exemple06.php
exemple07.php
exemple08.php
exemple09.php
exemple10.php
exemple11.php
exemple12.php
exemple13.php
forms.php
groups.php
js1.php
js2.php
js3.php
qrcode.php
radius.php
regle.php
svg.php
svg_tiger.php
svg_tree.php
ticket.php
utf8.php
locale
_LGPL.txt
_changelog.txt
_lisez_moi.txt
_read_me.txt
html2pdf.class.php
ul.png
ul2.png
ul3.png
htmlpurifier-4.10.0
images
prints
prints3
stud
Kennwortwechsel.php
hauptframe.php
htmlpurifier-4.10.0.zip
index.php
index_alt.php
index_db.php
index_frame.htm
index_ldap.php
login.php
logout.php
menuframe.htm
styles_pc.css
testpdf.php
topframe.php
74 lines
1.9 KiB
PHP
Executable File
74 lines
1.9 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* HTML2PDF Librairy - example
|
|
*
|
|
* HTML => PDF convertor
|
|
* distributed under the LGPL License
|
|
*
|
|
* @author Laurent MINGUET <webmaster@html2pdf.fr>
|
|
*
|
|
*/
|
|
|
|
$generate = isset($_GET['make_pdf']);
|
|
$nom = isset($_GET['nom']) ? $_GET['nom'] : 'inconnu';
|
|
|
|
$nom = substr(preg_replace('/[^a-zA-Z0-9]/isU', '', $nom), 0, 26);
|
|
|
|
if ($generate) {
|
|
ob_start();
|
|
} else {
|
|
?>
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/../htdocs4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="te../htdocs; charset=UTF-8" >
|
|
<title>Exemple d'auto génération de PDF</title>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
}
|
|
|
|
$url = dirname($_SERVER['REQUEST_URI']).'/res/exemple09.png.php?px=5&py=20';
|
|
if (substr($url, 0, 7)!=='http://') {
|
|
$url = 'http://'.$_SERVER['HTTP_HOST'].$url;
|
|
}
|
|
?>
|
|
<br>
|
|
Ceci est un exemple de génération de PDF via un bouton :)<br>
|
|
<br>
|
|
<img src="<?php echo $url; ?>" alt="image_php" ><br>
|
|
<br>
|
|
<?php
|
|
if ($generate) {
|
|
?>
|
|
Bonjour <b><?php echo $nom; ?></b>, ton nom peut s'écrire : <br>
|
|
<barcode type="C39" value="<?php echo strtoupper($nom); ?>" style="color: #770000" ></barcode><hr>
|
|
<br>
|
|
<?php
|
|
}
|
|
?>
|
|
<br>
|
|
<?php
|
|
if ($generate) {
|
|
$content = ob_get_clean();
|
|
require_once(dirname(__FILE__).'/../htdocs2pdf.class.php');
|
|
try
|
|
{
|
|
$html2pdf = new HTML2PDF('P', 'A4', 'fr');
|
|
$html2pdf->writeHTML($content);
|
|
$html2pdf->Output('exemple09.pdf');
|
|
exit;
|
|
}
|
|
catch(HTML2PDF_exception $e) {
|
|
echo $e;
|
|
exit;
|
|
}
|
|
}
|
|
?>
|
|
<form method="get" action="">
|
|
<input type="hidden" name="make_pdf" value="">
|
|
Ton nom : <input type="text" name="nom" value=""> -
|
|
<input type="submit" value="Generer le PDF" >
|
|
</form>
|
|
</body>
|
|
</html>
|