je découvre la classe Html2pdf, bravo pour tout ce travail.
Cependant je rencontre un problème lors de l'affichage en pdf, les css ne correspondent pas du tout avec le html...
Voici la page html (ceci est un exemple) :
<style type="text/css">
div.page
{
width: 800px;
margin: auto;
font: 18px bold;
max-height: 800px;
}
div.logo
{
width: 200px;
height: 200px;
position: absolute;
}
div.sous_logo
{
text-align: center;
font-size: 18px;
float: left;
margin: 200px 0 0 0;
color: #545151;
}
div.entete
{
height: 300px;
}
div.libelle
{
margin: 10px 0 0 450px;
}
div.client
{
width: 350px;
height: 150px;
margin: 60px 0 0 450px;
padding: 0 0 0 10px;
border: 2px dotted black;
}
div.corps
{
height: 300px;
margin: auto;
}
div.corps table
{
width: 100%;
}
div.titres
{
background-color: #dbd5c5;
text-align: center;
font: 20px black;
padding: 2px;
}
div.corps table td
{
text-align: right;
padding: 2px 0 2px 0;
border-bottom: 2px solid #dbd5c5;
}
div.total
{
height: 50px;
border-top: 2px solid black;
border-bottom: 2px solid black;
float: right;
margin: 40px 0 0 0;
line-height: 50px;
}
div.signature_limpius
{
float: left;
margin: 120px 0 0 0;
}
div.signature_client
{
margin: 120px 0 0 360px;
width: 480px;
}
div.pied
{
height: 200px;
}
div.conditions
{
margin: 250px 0 20px 0;
}
div.loi
{
float: left;
margin: 20px;
font: 15px black;
text-align: center;
}
</style>
<page>
<div class="page">
<div class="logo">
<img src="images/divers/logo.png" alt="">
</div>
<div class="sous_logo">
Création | hébergement
<br>
domaine.fr
<br>
SIRET : 000 000 00 0000
</div>
<div class="entete">
<div class="libelle">pdf du 4 Octobre 2010</div>
<div class="client">
<h3>Mr quelqu'un</h3>
1,rue d'ici<br>
00000 - LaBas
</div>
</div>
<div class="corps">
<table cellspacing="0" cellpadding="10px">
<tr class="titres">
<td>Code</td>
<td>Description</td>
<td>Quantité</td>
<td>Prix unitaire</td>
<td>Prix total</td>
</tr>
<tr>
<td>dgn</td>
<td>Création de la chartre graphique</td>
<td>1</td>
<td>262,00</td>
<td>262,00</td>
</tr>
<tr>
<td>bdd</td>
<td>Structure de la base de données</td>
<td>1</td>
<td>116,00</td>
<td>116,00</td>
</tr>
<tr>
<td>mod</td>
<td>Création du modèle</td>
<td>1</td>
<td>90,00</td>
<td>90,00</td>
</tr>
<tr>
<td>int</td>
<td>Intégration des scripts au modèle</td>
<td>1</td>
<td>240,00</td>
<td>240,00</td>
</tr>
<tr>
<td>bko</td>
<td>Création du back-office</td>
<td>1</td>
<td>348,00</td>
<td>348,00</td>
</tr>
<tr>
<td>dom</td>
<td>Implémentation sur le domaine ctcc31.fr</td>
<td>1</td>
<td>55,00</td>
<td>00,00</td>
</tr>
<tr>
<td>msg</td>
<td>Système de messagerie interne/externe</td>
<td>1</td>
<td>70,00</td>
<td>00,00</td>
</tr>
<tr>
<td>fxs</td>
<td>Ajout d'effets visuels, implémentation jQuery</td>
<td>1</td>
<td>65,00</td>
<td>00,00</td>
</tr>
</table>
<div class="total">
Total à régler : 1056,00 €
</div>
<div class="signature_limpius">
Pour l'entreprise (signature et cachet)
</div>
<div class="signature_client">
Pour le client (signature précédée de la mention: Lu et approuvé, bon pour accord)
</div>
</div>
<div class="pied">
<div class="conditions">
Conditions de réglement : Chèque à la livraison<br>
Date de validité : 4 Novembre 2010<br>
</div>
<div class="loi">
La loi n°92/1442 du 31 décembre 1992 nous fait l'obligation de vous indiquer que le non respect des conditions de paiement<br>
entraïne des intérêts de retard suivant modalités et taux minima défini par la loi.
<br><br>
TVA non applicable, article 293 B du CGI.
</div>
</div>
</div>
</page>