Witam!
Jako, ze w tym "dziale" php jestem nowicjuszem, mam do Was pytanie. Mianowicie probuje napisac skrypt generujacy pdfa zlozonego z kilku obrazkow wygenerowanych dynamicznie. Te obrazki sa generowane przez biblioteke GD i tutaj mam wlasciwie najwiekszy problem.
Wstawic obrazek, ktory jest "fizycznie" na serwerze to nie problem, ale jak mam w skrypcie odpowiednim obrazkom przypisac jakis konkretne zmienne/nazwy, zeby mozna je wstawic do pdfa.
Z gory dzieki za kazda pomoc smile.gif
Pozdrawiam

Ponizej kod php:
  1. <html>
  2.  <head>
  3.  <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
  4.  </head><body>
  5.  <form method="POST" action="<? echo $PHP_SELF;?>">
  6.  <table border=0>
  7.  <tr><td>Imiê:</td><td> <input name="imie" /></td>
  8.  <tr><td>Wiek:</td><td> <input name="wiek" /></td>
  9.  <tr><td>Mail:</td><td> <input name="mail" /></td>
  10.  <tr><td>Gadu-Gadu: </td><td><input name="gg" /></td>
  11.  <tr><td>Opis:</td><td><textarea name="opis"></textarea><td><input type="submit" value="Submit"></form></td><?php
  12. require 'PDF.php'; // Require the class.
  13.  
  14.  //pobierz dane z formularza
  15.  $u_imie=$_POST["imie"];
  16.  $u_wiek=$_POST["wiek"];
  17.  $u_mail=$_POST["mail"];
  18.  $u_gg =$_POST["gg"];
  19.  
  20.  
  21. $im = @imagecreate(1123, 451)
  22. or die("Cannot Initialize new GD image stream");
  23. $background_color = imagecolorallocate($im, 0, 0, 0);
  24. $text_color = imagecolorallocate($im, 233, 14, 91);
  25. imagestring($im, 10, 5, 5, "A Simple Text String", $text_color);
  26. imagejpeg($im);
  27. imagedestroy($im);
  28.  
  29. $im2 = @imagecreate(1123, 451)
  30. or die("Cannot Initialize new GD image stream");
  31. $background_color = imagecolorallocate($im2, 0, 0, 0);
  32. $text_color = imagecolorallocate($im2, 233, 14, 91);
  33. imagestring($im2, 10, 5, 5, "A Simple Text String", $text_color);
  34. imagejpeg($im2);
  35. imagedestroy($im2);
  36.  
  37. $im3 = @imagecreate(1123, 451)
  38. or die("Cannot Initialize new GD image stream");
  39. $background_color = imagecolorallocate($im3, 0, 0, 0);
  40. $text_color = imagecolorallocate($im3, 233, 14, 91);
  41. imagestring($im3, 10, 5, 5, "A Simple Text String", $text_color);
  42. imagejpeg($im3);
  43. imagedestroy($im3);
  44.  
  45.  
  46.  
  47. $pdf = &PDF::factory('p', 'a4'); // Set up the pdf object.
  48. $pdf->open();  // Start the document.
  49. $pdf->setCompression(false);  // Activate compression.
  50. //$pdf->setCompression(true);  // Activate compression.
  51. $pdf->addPage(); // Start a page.
  52.  
  53.  
  54. $pdf->setFont('Arial', '', 8); // Set font to courier 8 pt.
  55. $pdf->setFont('Times', '', 12);  // Set font to arial bold
  56. // italic 12 pt.
  57. $pdf->text(100, 100, $u_imie);  // Text at x=100 and y=100.
  58. $pdf->setFillColor('rgb', 0, 0, 0);
  59. $pdf->setFontSize(10); // Set font size to 20 pt.
  60. //$pdf->rect(20, 20, 20, 20, 'd'); // Poczatek x,y, Szerokosc +x, +y
  61. $pdf->rect(20, 20, 269, 107, 'd'); // Wysokosc x,y, Szerokosc x, y
  62. $pdf->rect(289, 20, 269, 107, 'd'); // Wysokosc x,y, Szerokosc x, y
  63. $pdf->image('OBRAZEK', 125, 25);  //tutaj chcialbym wstawic np. pierwszy obrazek, ale nie wiem jak go "zdefiniowac"
  64. $pdf->image('zdjecie.jpg', 25, 25);  // zdjecie wstawione z serwera
  65. $pdf->setFillColor('rgb', 0, 0, 0);  // Set text color to red.
  66.  
  67. $pdf->setDrawColor('rgb', 0, 0, 0);  // Set draw color to blue.
  68. $pdf->line(48, 38, 120, 38);  // Draw a line.
  69. $pdf->text(100, 200, 'HELLO WORLD!'); // Text at x=100 and y=200.
  70. $pdf->setDrawColor('rgb', 0, 0, 1);  // Set draw color to blue.
  71. $pdf->line(100, 202, 240, 202);  // Draw a line.
  72. $pdf->setFillColor('rgb', 1, 1, 0);  // Set fill/text to yellow.
  73. $pdf->rect(200, 300, 100, 100, 'fd'); // Draw a filled rectangle.
  74.  
  75.  
  76. $pdf->addPage(); // Add a new page.
  77.  
  78. $pdf->setFont('Arial', 'BI', 12);  // Set font to arial bold
  79. // italic 12 pt.
  80. $pdf->text(100, 100, 'Second page'); // Text at x=100 and y=100.
  81.  
  82. $pdf->setLineWidth(4); // Set line width to 4 pt.
  83. $pdf->circle(200, 300, 150, 'd');  // Draw a non-filled
  84. // circle.
  85. $pdf->output(foo.pdf); // Output the file named foo.pdf
  86. ?>