示例#1
0
         $arRowsWidth_tmp[$j] += $accumulated;
         $accumulated = 0;
     }
 }
 $x0 = $pdf->GetX();
 $y0 = $pdf->GetY();
 $pdf->SetFont($fontFamily, '', $fontSize);
 if (!is_null($arCells[$n][2])) {
     $text = $arCells[$n][2];
     $cellWidth = $arRowsWidth_tmp[2];
 } else {
     $text = $arCells[$n][6];
     $cellWidth = $arRowsWidth_tmp[6];
 }
 for ($l = 0; $pdf->GetStringWidth($text) > 0; $l++) {
     list($string, $text) = $pdf->splitString($text, $cellWidth - 5);
     if (!is_null($arCells[$n][1])) {
         $pdf->Cell($arRowsWidth_tmp[1], 15, $l == 0 ? $arCells[$n][1] : '', 0, 0, 'C');
     }
     if ($l == 0) {
         $x1 = $pdf->GetX();
     }
     if (!is_null($arCells[$n][2])) {
         $pdf->Cell($arRowsWidth_tmp[2], 15, $string);
     }
     if ($l == 0) {
         $x2 = $pdf->GetX();
     }
     if (!is_null($arCells[$n][3])) {
         $pdf->Cell($arRowsWidth_tmp[3], 15, $l == 0 ? $arCells[$n][3] : '', 0, 0, 'R');
     }
示例#2
0
$pdf->AddPage();
$y0 = $pdf->GetY();
$logoHeight = 0;
$logoWidth = 0;
if (CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false)) {
    list($imageHeight, $imageWidth) = $pdf->GetImageSize(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false));
    $imgDpi = intval(CSalePaySystemAction::GetParamValue('LOGO_DPI', false)) ?: 96;
    $imgZoom = 96 / $imgDpi;
    $logoHeight = $imageHeight * $imgZoom + 5;
    $logoWidth = $imageWidth * $imgZoom + 5;
    $pdf->Image(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false), $pdf->GetX(), $pdf->GetY(), -$imgDpi, -$imgDpi);
}
$pdf->SetFont($fontFamily, 'B', $fontSize);
$sellerName = CSalePaySystemAction::GetParamValue("SELLER_NAME", false);
if ($sellerName) {
    list($string, $text) = $pdf->splitString(CSalePdf::prepareToPdf($sellerName), $width - 10);
    $pdf->Cell($width, 15, $string, 0, 0, 'R');
    $pdf->Ln();
}
$sellerAddress = CSalePaySystemAction::GetParamValue("SELLER_ADDRESS", false);
if ($sellerAddress) {
    list($string, $text) = $pdf->splitString(CSalePdf::prepareToPdf($sellerAddress), $width - 10);
    $pdf->Cell($width, 15, $string, 0, 0, 'R');
    $pdf->Ln();
}
$sellerPhone = CSalePaySystemAction::GetParamValue("SELLER_PHONE", false);
if ($sellerPhone) {
    $sellerPhone = sprintf("Тел.: %s", $sellerPhone);
    $pdf->Cell($width, 15, $pdf->prepareToPdf($sellerPhone), 0, 0, 'R');
    $pdf->Ln();
}