public function draw(\PhpSigep\Pdf\ImprovedFPDF $pdf) { $pdf->saveState(); // quantos mm cabem dentro de um pt do pdf $un = 72 / 25.4; // Desenha o elipse $k = $pdf->k; $wRect = $un * 30 / $k; $h = $un * 28 / $k; $lineWidth = 2 / $k; $pdf->SetLineWidth($lineWidth); $x = $this->x; $y = $this->y; $rx = $wRect / 2; $ry = $h / 2; $elipse = new Elipse(); $pdf->SetDrawColor(0, 0, 0); $elipse->ellipse($pdf, $x, $y, $rx, $ry); // Escreve o texto $pdf->SetFont('Arial', 'BI'); $pdf->SetXY($x, $y + 10 / $k); $fontSize = 15; $texto = 'Carta'; $pdf->SetFontSize($fontSize); $pdf->Cell($wRect, 23 / $k, $texto, 0, 2, 'C'); //Faz os dois riscos brancos da parte inferior - lado esquerdo $pdf->SetDrawColor(255, 255, 255); $pdf->SetLineWidth(3 / $k); $x1 = $x + 11 / $k; $x2 = $x1 - 1 / $k; $y1 = $y + $h - 15.5 / $k; $y2 = $y1 + 1 / $k; $pdf->Line($x1, $y1, $x2, $y2); $space = 3.5 / $k; $x1 += $space; $x2 = $x1 - 1 / $k; $y1 += $space; $y2 = $y1 + 1 / $k; $pdf->Line($x1, $y1, $x2, $y2); $x1 = $x + 19.3 / $k; $x2 = $x1 - 0.85 / $k; $y1 = $y + 57.26 / $k; $y2 = $y1 + 0.85 / $k; $pdf->Line($x1, $y1, $x2, $y2); //Faz os dois riscos brancos da parte inferior - lado direito $pdf->SetDrawColor(255, 255, 255); $pdf->SetLineWidth(3 / $k); $x1 = $x + $wRect - 7.5 / $k; $x2 = $x1 + 1 / $k; $y1 = $y + $h - 17.5 / $k; $y2 = $y1 + 1 / $k; $pdf->Line($x1, $y1, $x2, $y2); $space = 3.5 / $k; $x1 += $space - 7.6 / $k; $x2 = $x1 + 1 / $k; $y1 += $space - 0.4 / $k; $y2 = $y1 + 1 / $k; $pdf->Line($x1, $y1, $x2, $y2); $x1 = $x1 - 4 / $k; $x2 = $x1 + 0.85 / $k; $y1 = $y + 58.26 / $k; $y2 = $y1 + 0.85 / $k; $pdf->Line($x1, $y1, $x2, $y2); // Número contrato e DR $pdf->SetFont('', '', 6); $texto = $this->accessData->getNumeroContrato() . '/' . $this->accessData->getAnoContrato() . '-DR/' . $this->accessData->getDiretoria()->getSigla(); $pdf->Cell($wRect, 6 / $k, $texto, 0, 2, 'C'); // Nome do remetente $pdf->SetFont('', 'B', 9); $pdf->MultiCell($wRect, 9 / $k, $pdf->_($this->nomeRemetente), 0, 'C'); // Escreve CORREIOS na parte inferior $text = 'CORREIOS'; $pdf->SetDrawColor(255, 255, 255); $pdf->SetLineWidth(15 / $k); $x1 = $x + 24.5 / $k; $x2 = $x1 + $pdf->GetStringWidth($text) - 9.5 / $k; $y1 = $y + $h - 6 / $k; $pdf->Line($x1, $y1, $x2, $y1); $pdf->SetFontSize(9); $circularText = new CircularText(); $circularText->CircularText($pdf, $x + $wRect / 2 + 0.5, $y / $k - 50, 80, $text, 'bottom', 110); $pdf->restoreLastState(); }
public function draw(\PhpSigep\Pdf\ImprovedFPDF $pdf) { $pdf->saveState(); // quantos mm cabem dentro de um pt do pdf $un = 72 / 25.4; // Desenha o retangulo $pdf->SetFillColor(0, 0, 0); $pdf->SetDrawColor(0, 0, 0); $k = $pdf->k; $wRect = $un * 31.5 / $k; $h = $un * 22.5 / $k; $lineWidth = 2 / $k; $pdf->SetLineWidth($lineWidth); $x = $this->x; $y = $this->y; $pdf->Rect($x, $y, $wRect, $h); // Escreve o texto PAC $pdf->SetFont('Arial', 'B', 27); $pdf->SetXY($x, $y + 4.5 / $k); $pdf->Cell($wRect, 27 / $k, 'PAC', 0, 2, 'C'); // Número contrato e DR $pdf->SetFont('', '', 6); $texto = $this->accessData->getNumeroContrato() . '/' . $this->accessData->getAnoContrato() . '-DR/' . $this->accessData->getDiretoria()->getSigla(); $pdf->Cell($wRect, 6 / $k, $texto, 0, 2, 'C'); // Nome do remetente $pdf->SetFont('', 'B', 9); $pdf->MultiCell($wRect, 9 / $k, $pdf->_($this->nomeRemetente), 0, 'C'); // Escreve o texto CORREIOS $pdf->SetDrawColor(255, 255, 255); $pdf->SetLineWidth(2 / $k); $x1 = $x + 3.15 * $un / $k; $x2 = $x1 + 0.54 / $k; $y1 = $y + $h + 0.45 / $k; $y2 = $y1 - 0.9 / $k; $space = 3.6 / $k; $pdf->Line($x1, $y1, $x2, $y2); $x1 += $space; $x2 += $space; $pdf->Line($x1, $y1, $x2, $y2); $x1 += $space; $x2 += $space; $pdf->Line($x1, $y1, $x2, $y2); $texto = 'CORREIOS'; $x1 += $space; $pdf->SetFontSize(9); $stringWidth = $pdf->GetStringWidth($texto); $x2 += $space + $stringWidth; $pdf->SetLineWidth(2.5 / $k); $pdf->Line($x1, $y + $h, $x2, $y + $h); $pdf->Text($x1, $y1 + 0.9, $texto); $x1 += $space + $pdf->GetStringWidth($texto); $x2 += $space; $pdf->Line($x1, $y1, $x2, $y2); $x1 += $space; $x2 += $space; $pdf->Line($x1, $y1, $x2, $y2); $x1 += $space; $x2 += $space; $pdf->Line($x1, $y1, $x2, $y2); $pdf->restoreLastState(); }
public function draw(\PhpSigep\Pdf\ImprovedFPDF $pdf) { $pdf->saveState(); // quantos mm cabem dentro de um pt do pdf $un = 72 / 25.4; // Desenha o elipse $k = $pdf->k; $wRect = $un * 35 / $k; $h = $un * 23 / $k; $lineWidth = 2 / $k; $pdf->SetLineWidth($lineWidth); $x = $this->x; $y = $this->y; $rx = $wRect / 2; $ry = $h / 2; $elipse = new Elipse(); $pdf->SetDrawColor(0, 0, 0); $elipse->ellipse($pdf, $x, $y, $rx, $ry); // Escreve o texto PAC $pdf->SetFont('Arial', 'BI'); $pdf->SetXY($x, $y + 5 / $k); $fontSize = 15; if ($this->tipoServico == self::SERVICE_E_SEDEX) { $texto = 'e-SEDEX'; } else { if ($this->tipoServico == self::SERVICE_SEDEX) { $texto = 'SEDEX'; } else { if ($this->tipoServico == self::SERVICE_SEDEX_10) { $fontSize = 13; $texto = 'SEDEX 10'; } else { if ($this->tipoServico == self::SERVICE_SEDEX_12) { $fontSize = 13; $texto = 'SEDEX 12'; } else { if ($this->tipoServico == self::SERVICE_SEDEX_HOJE) { $fontSize = 12; $texto = 'SEDEX Hoje'; } } } } } $pdf->SetFontSize($fontSize); $pdf->Cell($wRect, 23 / $k, $texto, 0, 2, 'C'); //Faz os dois riscos brancos da parte superior $pdf->SetDrawColor(255, 255, 255); $pdf->SetLineWidth(4 / $k); $x1 = $x + 11 / $k; $x2 = $x1 + 4.4 / $k; $y1 = $y + 12 / $k; $y2 = $y1 - 3 / $k; $pdf->Line($x1, $y1, $x2, $y2); $x1 = $x + $wRect - 11 / $k; $x2 = $x1 - 4.4 / $k; $pdf->Line($x1, $y1, $x2, $y2); //Faz os dois riscos brancos da parte inferior - lado esquerdo $pdf->SetDrawColor(255, 255, 255); $pdf->SetLineWidth(3 / $k); $x1 = $x + 11 / $k; $x2 = $x1 - 1 / $k; $y1 = $y + $h - 13.5 / $k; $y2 = $y1 + 1 / $k; $pdf->Line($x1, $y1, $x2, $y2); $space = 3.5 / $k; $x1 += $space; $x2 = $x1 - 1 / $k; $y1 += $space; $y2 = $y1 + 1 / $k; $pdf->Line($x1, $y1, $x2, $y2); $x1 = $x + 19.3 / $k; $x2 = $x1 - 0.85 / $k; $y1 = $y + 57.26 / $k; $y2 = $y1 + 0.85 / $k; $pdf->Line($x1, $y1, $x2, $y2); //Faz os dois riscos brancos da parte inferior - lado direito $pdf->SetDrawColor(255, 255, 255); $pdf->SetLineWidth(3 / $k); $x1 = $x + $wRect - 11 / $k; $x2 = $x1 + 1 / $k; $y1 = $y + $h - 13.5 / $k; $y2 = $y1 + 1 / $k; $pdf->Line($x1, $y1, $x2, $y2); $space = 3.5 / $k; $x1 += $space - 7.6 / $k; $x2 = $x1 + 1 / $k; $y1 += $space - 0.4 / $k; $y2 = $y1 + 1 / $k; $pdf->Line($x1, $y1, $x2, $y2); $x1 = $x1 - 4 / $k; $x2 = $x1 + 0.85 / $k; $y1 = $y + 58.26 / $k; $y2 = $y1 + 0.85 / $k; $pdf->Line($x1, $y1, $x2, $y2); // Número contrato e DR $pdf->SetFont('', '', 7); $texto = $this->accessData->getNumeroContrato() . '/' . $this->accessData->getAnoContrato() . '-DR/' . $this->accessData->getDiretoria()->getSigla(); $pdf->Cell($wRect, 7 / $k, $texto, 0, 2, 'C'); // Nome do remetente $pdf->SetFont('', 'B', 9); $pdf->MultiCell($wRect, 9 / $k, $pdf->_($this->nomeRemetente), 0, 'C'); // Escreve CORREIOS na parte inferior $text = 'CORREIOS'; $pdf->SetDrawColor(255, 255, 255); $pdf->SetLineWidth(10 / $k); $x1 = $x + 28 / $k; $x2 = $x1 + $pdf->GetStringWidth($text) - 3 / $k; $y1 = $y + $h - 3.8 / $k; $pdf->Line($x1, $y1, $x2, $y1); $pdf->SetFontSize(9); $circularText = new CircularText(); $circularText->CircularText($pdf, $x + $wRect / 2 + 1, $y - 6.5 / $k, 75, $text, 'bottom'); $pdf->restoreLastState(); }