'FPDF generates an automatic line break
Good morning everyone, I'm printing a format with FPDF, but there is a cell that contains the field "The line of business or gyre" does not respect the same line and it is downloaded, I have modified several times trying to adjust but I can not do it, could you guide me?
<?php
require('fpdf/fpdf.php');
$DateAndTime = date('d-m-Y');
$span_day = date("%A %d de %B del %Y");
class PDF extends FPDF{}
function nau_alta($pdf_date_y, $pdf_date_m, $pdf_date_d, $business_name, $tradename, $rfc, $street, $num_home, $mun, $cp, $col_homes, $state_home, $fiscal_adress, $phone, $mail, $gyre, $btwn_streets, $prop_rep, $num_people, $amount, $way_pay, $ttl, $file_name){
// Creación del objeto de la clase heredada
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetTextColor(56,56,56);
$pdf->SetFont('Arial','B',7);
$pdf->SetMargins(10,10,10,10);
$pdf->SetY(45);
$pdf->Setx(40);
$pdf->Cell(5,6,utf8_decode("X"),1, 0, 'L');
$pdf->Setx(115);
$pdf->Cell(5,6,utf8_decode(''.$pdf_date_d),1, 0, 'L');
$pdf->Setx(125);
$pdf->Cell(5,6,utf8_decode(''.$pdf_date_m),1, 0, 'L');
$pdf->Setx(150);
$pdf->Cell(10,6,utf8_decode(''.$pdf_date_y),1, 0, 'L');
$pdf->Ln(1);
$pdf->SetY(53);
$pdf->Setx(30);
$pdf->Cell(70, 6,utf8_decode(''.$business_name),1, 0, 'L');
$pdf->Setx(115);
$pdf->MultiCell(70, 5, utf8_decode(''.$fiscal_adress), 1, 'L', 0);
$pdf->Ln(1);
$pdf->SetY(63);
$pdf->Setx(30);
$pdf->Cell(70,6,utf8_decode(''.$tradename),0, 0, 'L');
$pdf->Setx(115);
$pdf->Cell(70,6,utf8_decode(''.$phone),0, 0, 'L');
$pdf->SetY(73);
$pdf->Setx(30);
$pdf->Cell(70,6,utf8_decode(''.$rfc),1, 0, 'L');
$pdf->Setx(115);
$pdf->Cell(70,6,utf8_decode(''.$mail),1, 0, 'L');
$pdf->SetY(83);
$pdf->Setx(30);
$pdf->MultiCell(70,5,utf8_decode(''.$street." No.".$num_home. " ,".$mun. ", C.P.".$cp. ", " .$col_homes. ", ".$state_home),1, 'L');
$pdf->Setx(115);
$pdf->Cell(45,6,utf8_decode(''.$gyre),1, 0, 'L');
$pdf->SetY(93);
$pdf->Setx(30);
$pdf->Cell(70,6,utf8_decode(''.$btwn_streets),1, 0, 'L');
$pdf->SetY(103);
$pdf->Setx(40);
$pdf->Cell(60,6,utf8_decode(''.$prop_rep),1, 0, 'L');
$pdf->SetY(113);
$pdf->Setx(50);
$pdf->Cell(10,6,utf8_decode(''.$num_people),1, 0, 'L');
$pdf->SetY(123);
$pdf->Setx(50);
$pdf->Cell(10,6,utf8_decode(''.$amount),1, 0, 'L');
$pdf->Setx(115);
$pdf->Cell(30,6,utf8_decode(''.$way_pay),1, 0, 'L');
$pdf->SetY(133);
$pdf->Setx(50);
$pdf->Cell(60,6,utf8_decode(''.$ttl),1, 0, 'L');
$pdf->Output('F', "pdfs/$file_name");
$pdf->Output();
};
?>
should be on the same line as the street and direction in general, but it shows like this
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|