Ver Mensaje Individual
  #9 (permalink)  
Antiguo 19/07/2011, 08:17
alx_salazar
 
Fecha de Ingreso: septiembre-2008
Mensajes: 192
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: PDF dinamico con Texto como marca de agua

Cita:
Iniciado por gildus Ver Mensaje
No puedes bajar el archivo? que raro, te pongo aqui el codigo por seacaso, y es el mismo que viene en el adjunto del link:

El archivo fpdf.php lo puedes bajar de la misma pagina:

Archivo: rotation.php
Código PHP:
Ver original
  1. <?php
  2. require('fpdf.php');
  3.  
  4. class PDF_Rotate extends FPDF
  5. {
  6. var $angle=0;
  7.  
  8. function Rotate($angle,$x=-1,$y=-1)
  9. {
  10.     if($x==-1)
  11.         $x=$this->x;
  12.     if($y==-1)
  13.         $y=$this->y;
  14.     if($this->angle!=0)
  15.         $this->_out('Q');
  16.     $this->angle=$angle;
  17.     if($angle!=0)
  18.     {
  19.         $angle*=M_PI/180;
  20.         $c=cos($angle);
  21.         $s=sin($angle);
  22.         $cx=$x*$this->k;
  23.         $cy=($this->h-$y)*$this->k;
  24.         $this->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',$c,$s,-$s,$c,$cx,$cy,-$cx,-$cy));
  25.     }
  26. }
  27.  
  28. function _endpage()
  29. {
  30.     if($this->angle!=0)
  31.     {
  32.         $this->angle=0;
  33.         $this->_out('Q');
  34.     }
  35.     parent::_endpage();
  36. }
  37. }
  38. ?>


Archivo: watermark.php
Código PHP:
Ver original
  1. <?php
  2. require('rotation.php');
  3.  
  4. class PDF extends PDF_Rotate
  5. {
  6. function Header()
  7. {
  8.     //Put the watermark
  9.     $this->SetFont('Arial','B',50);
  10.     $this->SetTextColor(255,192,203);
  11.     $this->RotatedText(35,190,'W a t e r m a r k   d e m o',45);
  12. }
  13.  
  14. function RotatedText($x, $y, $txt, $angle)
  15. {
  16.     //Text rotated around its origin
  17.     $this->Rotate($angle,$x,$y);
  18.     $this->Text($x,$y,$txt);
  19.     $this->Rotate(0);
  20. }
  21. }
  22.  
  23. $pdf=new PDF();
  24. $pdf->AddPage();
  25. $pdf->SetFont('Arial','',12);
  26. $txt="FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say ".
  27.     "without using the PDFlib library. F from FPDF stands for Free: you may use it for any ".
  28.     "kind of usage and modify it to suit your needs.\n\n";
  29. for($i=0;$i<25;$i++)
  30.     $pdf->MultiCell(0,5,$txt,0,'J');
  31. $pdf->Output();
  32. ?>


Saludos

Hola muchas gracias por la ayuda, el primer codigo me arroja en blanco no me da el pdf el segundo lo entiendo mejo pero la libreria no la puedo bajar trato de entrar y secaduca la pagina.... ayudame el primer codigo es para combinar los pdfs???? soy nuevo en este tema y porfavor si nesecito ayuda
Gracias