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

Langage PHP Discussion :

style export php vers word


Sujet :

Langage PHP

  1. #1
    Membre du Club
    Femme Profil pro
    Développeur Java
    Inscrit en
    Mars 2012
    Messages
    61
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2012
    Messages : 61
    Points : 58
    Points
    58
    Par défaut style export php vers word
    Bonjour tous le monde,
    je cherche créer un fichier word selon des mesure précise , j'ai réussie a le faire , mais le probléme que l'affiche se change selon l'ecran (la résolution je pense) dans les mesure que j'ai donnée en pixel se change , Voici mon code pour bien comprendre :

    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
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    <?php header("Content-Type: application/msword; name=ListeDemande.doc");
    header("Content-disposition: attachment; filename=ListeDemande.doc"); ?>
    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns="http://www.w3.org/TR/REC-html40">	
     
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name=ProgId content=Word.Document>
    <meta name=Generator content="Microsoft Word 11">
    <meta name=Originator content="Microsoft Word 11">
    <title>$titrefacture</title>
    <style>
     @font-face
     {font-family:Tahoma;
     panose-1:2 11 6 4 3 5 4 4 2 4;
     mso-font-charset:0;
     mso-generic-font-family:swiss;
     mso-font-pitch:variable;
     mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
     /* Style Definitions */
     p.MsoNormal, li.MsoNormal, div.MsoNormal
     {mso-style-parent:"";
     margin:0cm;
     margin-bottom:.0001pt;
     mso-pagination:widow-orphan;
     text-autospace:none;
     font-size:10.0pt;
     font-family:"Times New Roman";
     mso-fareast-font-family:"Times New Roman";}
    h1
     {mso-style-next:Normal;
     margin:0cm;
     margin-bottom:.0001pt;
     mso-pagination:widow-orphan;
     page-break-after:avoid;
     mso-outline-level:1;
     tab-stops:center 248.1pt;
     text-autospace:none;
     font-size:10.0pt;
     font-family:Tahoma;
     mso-font-kerning:0pt;
     text-decoration:underline;
     text-underline:single;}
    h2
     {mso-style-next:Normal;
     margin:0cm;
     margin-bottom:.0001pt;
     text-align:center;
     mso-pagination:widow-orphan;
     page-break-after:avoid;
     mso-outline-level:2;
     text-autospace:none;
     font-size:16.0pt;
     font-family:Tahoma;}
    h3
     {mso-style-next:Normal;
     margin-top:6.0pt;
     margin-right:0cm;
     margin-bottom:0cm;
     margin-left:0cm;
     margin-bottom:.0001pt;
     text-align:left;
     mso-pagination:widow-orphan;
     page-break-after:avoid;
     mso-outline-level:3;
     text-autospace:none;
     font-size:11.0pt;
     font-family:Tahoma;
     font-style:italic;}
    p.MsoHeader, li.MsoHeader, div.MsoHeader
     {margin:0cm;
     margin-bottom:.0001pt;
     mso-pagination:widow-orphan;
     tab-stops:center 8.0cm right 16.0cm;
     text-autospace:none;
     font-size:10.0pt;
     font-family:"Times New Roman";
     mso-fareast-font-family:"Times New Roman";}
    p.MsoFooter, li.MsoFooter, div.MsoFooter
     {margin:0cm;
     margin-bottom:.0001pt;
     mso-pagination:widow-orphan;
     tab-stops:center 8.0cm right 16.0cm;
     text-autospace:none;
     font-size:10.0pt;
     font-family:"Times New Roman";
     mso-fareast-font-family:"Times New Roman";}
     /* Page Definitions */
     @page Section1
     {size:595.3pt 841.9pt;
     margin:2cm 0.5cm 0cm 1.0cm ;
     mso-header-margin:1.5cm;
     mso-footer-margin:0cm;
      mso-paper-source:0;}
    div.Section1
     {page:Section1;}
     /* List Definitions */
     @list l0
     {mso-list-id:891423539;
     mso-list-type:simple;
     mso-list-template-ids:67895297;}
    @list l0:level1
     {mso-level-number-format:bullet;
     mso-level-text:F0B7;
     mso-level-tab-stop:18.0pt;
     mso-level-number-position:left;
     margin-left:18.0pt;
     text-indent:-18.0pt;
     font-family:Symbol;
     mso-bidi-font-family:Symbol;}
    ol
     {margin-bottom:0cm;}
    ul
     {margin-bottom:0cm;}
    </style>
    </head>	
     
    <body lang=FR style='tab-interval:35.4pt;text-justify-trim:punctuation'>
    <div class=Section1>	
     
    <?php 
    include ('cnx.php');  
    $test = "select id,nom,prenom,adresse,ville,pays,tel,email,label,etat,date_demande,code_postal from  educatelWP_prospect join educatelWP_demande_documentation using(id_procpet) join educatelWP_formation using(id_formation) where etat='Documentation demandee'" ; 
    mysql_query("SET NAMES UTF8") ;
     
    $res=mysql_query($test);
    mysql_query("SET NAMES UTF8") ;
     
    ?>
    <table style="margin:0;padding:0;width:755px;">
    <?php 
    while($date=mysql_fetch_array($res)) 
    { ?>
    <tr style="width:755px;margin:0 auto;padding:0"><td style="vertical-align:top;height:142px;width:40%;"><?php echo $date['nom']." ".$date['prenom']."<br/>" ;
    echo $date['adresse'].' '.$date['ville'].' '.$date['code_postal'];
     
    echo chr(13) . chr(10) ;
     ?></td>
     <td style="vertical-align:top;width:40%">
    <?php echo $date['tel']."<br/>";  
    echo $date['label']."<br/>";
     
     ?></td></tr>
    <?php } 
    ?>
     
     
    </table>
    </body>	
     
    </html>
    j'éspére que vous avez compris ce que je veux dire
    je cherche a mettre mon style static ,, MErci et n'hésitez pas à me répondre

  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
    Ce que tu produis est un document HTML, pas un document Word.
    Ton problème concerne la façon dont Word peut lire du HTML, mais pas PHP.

    Puisque tu conclues toi même qu'il ne faut pas donner les dimensions en pixel, pourquoi tu n'essaies pas en centimètres ou en point ?
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Membre du Club
    Femme Profil pro
    Développeur Java
    Inscrit en
    Mars 2012
    Messages
    61
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2012
    Messages : 61
    Points : 58
    Points
    58
    Par défaut
    merci sabotage pour m'avoir répondu,
    je vais essayer de donner des valeur en cm même que je pense que c'est la même chose ,je vais tester ça ;Merci

  4. #4
    Membre du Club
    Femme Profil pro
    Développeur Java
    Inscrit en
    Mars 2012
    Messages
    61
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Mars 2012
    Messages : 61
    Points : 58
    Points
    58
    Par défaut
    ça marche trés bien ; les valeurs en cm ne change pas , merci

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

Discussions similaires

  1. [Access] Export enregistrements vers Word
    Par PhRey dans le forum Access
    Réponses: 17
    Dernier message: 21/12/2006, 07h43
  2. [VBA-Word] Exportation Excel vers Word
    Par le_sonic dans le forum VBA Word
    Réponses: 6
    Dernier message: 20/12/2006, 17h18
  3. export état vers word problème sur l'en-tête
    Par bucasso dans le forum Access
    Réponses: 7
    Dernier message: 08/09/2006, 16h51
  4. Exporter graphique vers word
    Par Junior_jef dans le forum Access
    Réponses: 1
    Dernier message: 31/08/2006, 11h25
  5. Exporter DataReport vers Word
    Par badrel dans le forum VBA Word
    Réponses: 2
    Dernier message: 23/12/2005, 08h33

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