Liberia TCPDF
Publicado por Andres (5 intervenciones) el 29/01/2019 17:55:37
Estoy utilizando la libreria de generar pdf - "TCPDF" y tengo textos con tildes, pero no me los muestra aparecen siempre un "?" que podria hacer?
este es mi codigo
este es mi codigo
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
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
//ocultar linea superior
$pdf->setPrintHeader(false);
//establecer margin por defecto
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'tcpdf/examples/lang/spa.php')) {
require_once(dirname(__FILE__).'tcpdf/examples/lang/spa.php');
$pdf->setLanguageArray($l);
}
//tipografía
$pdf->SetFont('dejavusans', '', 10);
$pdf->AddPage();
//Agregar imagen lado superior izquierda
$pdf->Image('../img/logo-institucional-pdf.png',120, 15, 65, 20);
//Agregar celdas
$pdf->Cell(0,10,"",0,1);
// create some HTML content
$html = '<table border="0" style="text-align:left; ">
<tr>
<td style="width: 300px;">Bogota, '.$fecha_actual.'</td>
<td>Oficio No. '.$reg['numero_folio_respuesta'].'</td>
</tr>
<br><br><br><br><br><br>
<tr>
<td>Señora:</td>
</tr>
<tr>
<td><strong>'.utf8_decode($reg['nom_usu']).'</strong></td>
<td><strong>Referencia:</strong> Respuesta a '.utf8_decode($reg['nom_tip']).'</td>
</tr>
<br><br><br><br>
<tr>
<td>Reciba un saludo de paz y bienestar,</td>
</tr>
<br>
<tr>
<td style="width: 500px;">Dando alcance a su PQRSF radicado el pasado '.$reg['fecha_pqrsf'].', me permito dar respuesta en los siguientes términos:
</td>
</tr>
<br><br>
<tr>
<td style="width: 500px; text-align:justify; ">'.$reg['descrip'].'</td>
</tr>
<br><br><br>';
if($numero_filas >0){
while($fila=mysqli_fetch_array($result)){
$i++;
$nombre_adjunto = $fila['nom'];
$carpeta_adjunto = $fila['nom_2'];
$extension_adjunto = $fila['nom_3'];
$directory = "../archivos/".$carpeta_adjunto."/".$nombre_adjunto.".".$extension_adjunto;
$html.='<tr>
<td><a href="'.$directory.'">Archivo'.$i.'</a></td>
</tr>';
}
}
$html.='<br><br><br>
<tr>
<td>Cordialmente,</td>
</tr>
<br><br><br><br>
<tr>
<td><strong>'.$reg['nom_4'].'<br>Auxiliar Economico<br>'.utf8_decode($reg['nom_5']).'</strong></td>
</tr>
</table>';
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
// reset pointer to the last page
$pdf->lastPage();
$pdf->Output('Respuesta-solicitud-PQRS.pdf', 'I');
Valora esta pregunta


1