IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

[FPDF] génération de pdf avec fpdf à partir d'un document html [Fait]


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Août 2008
    Messages
    52
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2008
    Messages : 52
    Points : 39
    Points
    39
    Par défaut [FPDF] génération de pdf avec fpdf à partir d'un document html
    Salut a tous, je programme en php et je suis bloquer au niveau de l'utilisation de la lib fpdf pour faire mes fichiers PDF. Mon pb est le suivant:

    je fais une projet et dans mon projet j'ai une page html et je voudrais générer automatiquement un doc PDF à partir de celle ci. je ne sais pas comment le faire svp aidez moi.

    voici le script de ma page print.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    <?php 
    include('includes/mysql_connect.php');
     
    $sql0="SELECT * FROM pw_commande";
    $result0=mysql_query($sql0);
    $n=mysql_num_rows($result0);
     
    $sql="SELECT * FROM pw_commande where ID='$n'";
    $result=mysql_query($sql);
    $commande=mysql_fetch_array($result);
     
    $sql3="SELECT * FROM pw_client WHERE codecl='$commande[IDclient]'";
    $result3=mysql_query($sql3);
    $client=mysql_fetch_array($result3);
     
     
    ?>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Bon &agrave; payer</title>
    <link href="css/print_css.css" rel="stylesheet" type="text/css" media="ALL" />
    </head>
     
    <body>
    <div id="wrapper">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="50%" align="center"><img src="images/pwb_logo.jpg" alt="PromoWeb" width="342" height="107" longdesc="http://www.promowebsa.net" /></td>
          <td width="50%" align="center"><img src="images/futurex.jpg" alt="FUTUREX" width="146" height="75" longdesc="http://www.futurexing.com" /></td>
        </tr>
      </table>
      <p class="contacts">Adress : Avenue Kennedy, Yaound&eacute; | T&eacute;l. : 22237273<br />
      http://www.promowebsa.net
    </p>
      <h3>BON A PAYER
      </h3>
      <table width="100%" cellpadding="2" cellspacing="2" class="num-date">
        <tr>
          <td width="50%" class="num"><?php echo "Numéro : ".$commande["ID"];?></td>
          <td width="50%" class="date"><?php echo "Le ".date("d/m/Y h:m:s",$commande["date"]);?></td>
        </tr>
      </table>
      <table width="775" cellpadding="2" cellspacing="2" class="content">
      <tr>
        <td width="140">Devise</td>
        <td colspan="2"><span class="information">: <strong>XAF Franc CFA (Zone BEAC)</strong> </span></td>
        <td width="249">&nbsp;</td>
      </tr>
      <tr>
        <td>Client</td>
        <td colspan="3"><span class="information">: <?php echo "".$client["nomcl"]." ".$client["prenomcl"];?> </span></td>
        </tr>
      <tr>
        <td>T&eacute;l&eacute;phone</td>
        <td><span class="information">: <?php echo "".$client["telephone"];?> </span></td>
        <td width="120">e-mail</td>
        <td><span class="information">: <?php echo "".$client["email"];?> </span></td>
      </tr>
      <tr>
        <td>Produit</td>
        <td><span class="information">: <?php echo "".$commande["produit"];?> </span></td>
        <td>Marque</td>
        <td><span class="information">: <?php echo "".$commande["marque"];?> </span></td>
      </tr>
      <tr>
        <td height="50">Pr&eacute;cision</td>
        <td colspan="2" valign="top"><span class="information">: <?php echo "".$commande["detail"];?> </span></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>URL</td>
        <td colspan="3"><span class="information">: <?php echo "".$commande["url"];?> </span></td>
        </tr>
      <tr>
        <td>Montant &agrave; payer </td>
        <td><span class="information">: <?php echo "".$commande["prixpromoweb"];?> </span></td>
        <td>Avance</td>
        <td><span class="information">: <?php echo "".$commande["prixavance"];?> </span></td>
      </tr>
      <tr>
        <td>N&deg; Versement </td>
        <td colspan="2"><span class="information">: Information </span></td>
        <td>&nbsp;</td>
      </tr>
    </table>
     
      <div id="bank-inf"><fieldset><legend>Informations pour le versement bancaire</legend>
          <table width="100%" class="content">
     
            <tr>
              <td width="120">B&eacute;n&eacute;ficiaire</td>
              <td colspan="3"><span class="information">: Futurex </span></td>
            </tr>
            <tr>
              <td>Banque 1 </td>
              <td><span class="information">: ECOBANK </span></td>
              <td width="100">Compte</td>
              <td><span class="information">: 2001011219849 </span></td>
            </tr>
            <tr>
              <td>Banque 2 </td>
              <td><span class="information">: EXPRESS UNION NIKI MC </span></td>
              <td>Compte</td>
              <td><span class="information">: 37180011040001830 </span></td>
            </tr>
          </table>
      </fieldset></div>
      <span class="printbutton"><a href="#" onclick="javascript:window.print(); return false;" title="Version imprimable"><img src="images/printButton.png" width="16" height="16" border="0" align="left" /> Imprimer </a></span></div>
    </body>
    </html>

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Tu as des scripts dans la doc pour faire du html->pdf.

    http://www.fpdf.org/en/script/index.php
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Génération de PDF avec FPDF sur un serveur Apache2
    Par almarean dans le forum Apache
    Réponses: 6
    Dernier message: 27/01/2023, 15h02
  2. Génération de pdf avec permission
    Par so007 dans le forum Jasper
    Réponses: 1
    Dernier message: 07/12/2007, 10h50
  3. Problème de génération de pdf avec Birt
    Par nabolo dans le forum BIRT
    Réponses: 2
    Dernier message: 15/11/2007, 09h36
  4. [FPDF] génération de pdf avec Fpdf sous firefox
    Par discogarden dans le forum Bibliothèques et frameworks
    Réponses: 6
    Dernier message: 08/06/2006, 10h50

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo