salto de linea en un reporte PDF
Publicado por zendi (1058 intervenciones) el 31/10/2017 21:43:01
Tengo este codigo en PDF pero necesito crear un salto de linea para la variable que esta en negritas ya que es un campo de texto, actualmente el texto sobrepasa el limite del reporte. Si alguien puediera darme una idea.
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
<?php
require('WriteTag.php');
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
$idprescripcion = $_GET['idpres'];
$recibos = "SELECT * FROM prescripcion WHERE id_prescripcion = '$idprescripcion'";
class PDF extends PDF_WriteTag
{
//Cabecera de página
function Header()
{
$this->SetFont('Arial','B',8);
$this->Cell(90, 5, 'Titulos', 0, 0, 'L');
$this->Ln(6);
$this->Cell(95, 5, 'Fecha: '.date('d/m/Y'), 0, 1, 'L');
//150 = Indica el margen derecho
// ('./imagenes/logo.JPG',180=Margen derecho,5= Margen Izquierdo,30,25);
// $this->Image('./img/edificio.JPG',180,5,30,25);
//Select Arial bold 15
$this->SetFont('Arial','B',15);
$this->Ln(25);
//Move to the right
$this->Cell(80);
//Framed title
// $this->Cell(30,10,'Recibo de Pago',0,0,'C');
$this->SetFont('Arial','B',8);
// $this->Cell(95, 5, 'Fecha: '.date('d/m/Y'), 0, 0, 'R');
//Line break
$this->Ln(40);
$this->SetFont('Arial','B',8);
}
//Pie de página
function Footer()
{
//Posición: a 1,5 cm del final
$this->SetY(-12);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Número de página
$this->Cell(0,10,'Pag '.$this->PageNo(),0,0,'C');
}
}//--Fin de la Clase
//Creación del objeto de la clase heredada
$pdf=new PDF('P','mm','Letter');
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
$seleccionados = @pg_query($conexion,$recibos);
while($select2 = @pg_fetch_array($seleccionados)):
$descripcion = $select2['descripcion'];
//$pdf->Line($pdf->GetX(), $pdf->GetY(), 205, $pdf->GetY());
$pdf->Ln(3);
$pdf->AddPage();
$pdf->SetFont('Arial','B',10);
// $pdf->Cell(20,4,'descripcion:',0);
// $pdf->Cell(26,4,$select2['descripcion'],0,1,'R');
// $pdf->Cell(20,4,'Indicaciones Medicas:',0);
$pdf->Cell(100,10,$descripcion,0,1,'R');
endwhile;
$pdf->Output();
$pdf->Close();
?>
Valora esta pregunta


0