Ah ben, ce n'est pas aussi simple. Il va falloir, avec FPDF redessiner toute la page. Il existe HTML2PDF qui convertit, dans une certaine mesure ta page en PDF.Ce que je veux faire, c'est mettre un bouton genre imprimer et que ca me genrere la page complete dans un format pdf.
Code : Tout sélectionner
<?php
require('html2fpdf.php');
// activate Output-Buffer:
ob_start();
//START-OF-PHP code
(...) // PHP code here
//END-OF-PHP code
// Output-Buffer in variable:
$htmlbuffer=ob_get_contents();
// delete Output-Buffer :
ob_end_clean();
require('html2fpdf.php');
$pdf=new PDF();
$pdf->AddPage();
$pdf->WriteHTML($htmlbuffer);
$pdf->Output(); //Outputs on browser screen
?><?
require_once('html2fpdf/html2fpdf.php');
// activate Output-Buffer:
ob_start();
?>
Code de la page:Code : Tout sélectionner
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<META NAME="KEYWORDS" CONTENT="<?=@$config['keywords'];?>">
<META NAME="OWNER" CONTENT="<?=@$config['owner'];?>">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="<?=@$config['content-language'];?>">
<META NAME="ROBOTS" CONTENT="<?=@$config['robots'];?>">
<META NAME="REVISIT-AFTER" CONTENT="<?=@$config['revisit-after'];?>">
<link rel="stylesheet" type="text/css" href="http://............................................/templates/default/style1.css" />
</head>
<body link="#0000FF" vlink="#0000FF" alink="#0000FF">
<div id="wrap">
<!-- HEADER -->
<!-- Header banner background -->
<div id="header-banner">
<!-- Header top navigation -->
<div id="header-nav-top">
<ul>
...
<div class="right-column-box-standard2">
<div class="right-column-title-standard">
<div align="center">Espace publicitaire </div>
</div>
<p align="center">
<!-- la publicite verticale -->
<?=$content['banner'];?>
</p>
<div align="center">Liens additionnels </div>
<p align="center">
<?=@$content['liens'];?>
</p>
</div>
</div>
</body>
</html>
<?
// Output-Buffer in variable:
$html=ob_get_contents();
// delete Output-Buffer
ob_end_clean();
$pdf = new HTML2FPDF();
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$pdf->WriteHTML($html);
$pdf->Output('doc.pdf','I');
?>
Est-ce toi qui gère le serveur ?URL file-access is disabled in the server configuration in html2fpdf.php on line 2211