Skip to content

Instantly share code, notes, and snippets.

@gbaudoin
Last active November 1, 2018 20:05
Show Gist options
  • Save gbaudoin/287cc64342a10e03bfac to your computer and use it in GitHub Desktop.
Save gbaudoin/287cc64342a10e03bfac to your computer and use it in GitHub Desktop.
Gabarit pour un BVR en PDF avec FPDF
<?php
$fpdf = new Fpdf('L', 'in', ['8.26772', '5.826772']);
$fpdf->fontpath = storage_path() . '/fonts/';
// Font OCR-B from http://sourceforge.jp/projects/tsukurimashou/releases/56948
$fpdf->AddFont('OCR', '', 'OCRB.php');
$fpdf->AddPage();
$fpdf->SetFont('OCR','',10);
$fpdf->SetXY(48.2*1/10, 8.5*1/6);
$fpdf->Cell(33*1/10,1*1/6,'12 34567 89012 34567 89012 34567');
$fpdf->SetXY(2*1/10, 12.5*1/6);
$fpdf->Cell(15*1/10,1*1/6,'899', null, null, 'R');
$fpdf->SetXY(19*1/10, 12.4*1/6);
$fpdf->Cell(4*1/10,1*1/6,'90');
$fpdf->SetXY(25*1/10, 12.4*1/6);
$fpdf->Cell(16*1/10,1*1/6,'899', null, null, 'R');
$fpdf->SetXY(43*1/10, 12.4*1/6);
$fpdf->Cell(4*1/10,1*1/6,'90');
$fpdf->SetXY(26*1/10, 21*1/6);
$fpdf->Cell(33*1/10,1*1/6,'0100000989009>123456789012345678901234567+ 012345578>');
$fpdf->Output();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment