| 12
 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
 
 | <?php
 
$pdf = pdf_new();
 
if (!pdf_open_file($pdf, "")) {  
     print ("error");
     exit(0);
     };
 
    pdf_set_info($pdf, "Numero", "fx bois");
    pdf_set_info($pdf, "Titre", "exmple");
    pdf_set_info($pdf, "Resume", "resume");
 
$db = mysql_connect('localhost', 'xxxx', 'xxxxxx');
mysql_select_db('bd'); 
 
  $sql="select * from auteur";
  $livres = mysql_query($sql);
 
  $liste ="";
 
  while (($livre = mysql_fech_assoc($livres)) !== false) {
 
  $Numero=$livre['Id'];
  $Titre=$livre['Titre'];
  pdf_begin_page($pdf, 595, 845);
 
  pdf_add_bookmark($pdf, "fiche $Titre",0,0);
  $font=pdf_findfont($pdf, "Hevetica", "host", 0);
  if ($font) pdf_setfont($pdf, $font, 30);
  pdf_set_value($pdf, "textrendering", 11);
  pdf_show_xy($pdf, $Titre, 50, 750);
  pdf_moveto($pdf, 50, 70);
  pdf_stroke($pdf);
  pdf_end_page($pdf);
 
  }
  mysql_close($db);
 
  pdf_close($pdf);
  $buf = pdf_get_buffer($pdf);
  $len=strlen($buf);
 
 
  header("Content-type: applicaton/pdf");
  header("Content-Lentgh: $len");
  header("Content-Disposition: inline; filename=fichier-livre.pdf");
  print($buf);
  pdf_delete($pdf);
 
?> | 
Partager