care certificate font Corsiva
This commit is contained in:
parent
3db4200e48
commit
93799baacc
@ -48,6 +48,22 @@ class CertificateService {
|
||||
$this->rootFolder = $rootFolder;
|
||||
}
|
||||
|
||||
private function signatureImageExists(){
|
||||
$storage = $this->rootFolder->getUserFolder(self::DEFAULT_NEXTCLOUD_ADMIN);
|
||||
try{
|
||||
if(isset($storage)){
|
||||
$storage->get("/.gestion/sign.png");
|
||||
$signatureExist = true;
|
||||
}else{
|
||||
$signatureExist = false;
|
||||
}
|
||||
}
|
||||
catch(\OCP\Files\NotFoundException $e) {
|
||||
$signatureExist = false;
|
||||
}
|
||||
return $signatureExist;
|
||||
}
|
||||
|
||||
private function getLogo(){
|
||||
$storage = $this->rootFolder->getUserFolder(self::DEFAULT_NEXTCLOUD_ADMIN);
|
||||
try{
|
||||
@ -86,7 +102,10 @@ class CertificateService {
|
||||
$pdfFilename = $this->GetCareCertificateFilename($devisOfDefunt);
|
||||
$filenamePath = $clean_folder.$careCertificateFolder.$pdfFilename.'.pdf';
|
||||
$pdf = new CareCertificatePdfHandler();
|
||||
$pdf->SetCareCertificateData($devisOfDefunt,$logo);
|
||||
$pdf->AddFont('Corsiva','','Monotype-Corsiva-Regular.php');
|
||||
$pdf->AddFont('Corsiva Bold','','Monotype-Corsiva-Bold.php');
|
||||
$signatureImageExist = $this->signatureImageExists();
|
||||
$pdf->SetCareCertificateData($devisOfDefunt,$logo,$signatureImageExist);
|
||||
$pdf->SetCareCertificate();
|
||||
try {
|
||||
$storage->newFolder($folderDestination);
|
||||
|
||||
@ -36,11 +36,13 @@ class CareCertificatePdfHandler extends FPDF {
|
||||
|
||||
private $devisOfDefunt = [];
|
||||
private $logo = null;
|
||||
private $logoPath = "/var/www/html/data/admin/files/.gestion/";
|
||||
private $signatureImageExist = false;
|
||||
private $imagePath = "/var/www/html/data/admin/files/.gestion/";
|
||||
|
||||
function Header()
|
||||
{
|
||||
if($this->logo != "nothing"){
|
||||
$this->Image($this->logoPath."logo.png", 10, 10, 75, 25);
|
||||
$this->Image($this->imagePath."logo.png", 10, 10, 75, 25);
|
||||
}
|
||||
else{
|
||||
$this->Cell(55,30,'');
|
||||
@ -48,15 +50,16 @@ class CareCertificatePdfHandler extends FPDF {
|
||||
}
|
||||
function Footer()
|
||||
{
|
||||
$this->SetY(-15);
|
||||
$this->SetFont('Arial', '', 8);
|
||||
$this->SetY(-18);
|
||||
$this->SetFont('Corsiva', '', 10);
|
||||
$this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->legal_one)), 0, 'C');
|
||||
$this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->adresse)), 0,'C');
|
||||
}
|
||||
|
||||
public function SetCareCertificateData(array $devisOfDefunt,$logo = null){
|
||||
public function SetCareCertificateData(array $devisOfDefunt,$logo = null,$signatureImageExist = false){
|
||||
$this->devisOfDefunt = $devisOfDefunt;
|
||||
$this->logo = $logo;
|
||||
$this->signatureImageExist = $signatureImageExist;
|
||||
}
|
||||
|
||||
public function SetCareCertificate(){
|
||||
@ -70,18 +73,28 @@ class CareCertificatePdfHandler extends FPDF {
|
||||
private function SetSigning(){
|
||||
$this->SetXY(140,$this->GetY() + 30);
|
||||
$this->Cell(0,10,'Cachet et signature');
|
||||
|
||||
if($this->signatureImageExist){
|
||||
$this->Image($this->imagePath."sign.png", 135, $this->GetY() + 12, 55, 30);
|
||||
}
|
||||
}
|
||||
|
||||
private function SetCareCertificateContent(){
|
||||
$this->SetFont('Arial', '', 12);
|
||||
$this->SetFont('Corsiva', '', 14);
|
||||
$this->Cell(0,7,FileExportHelpers::FormatTextForExport('La Société '. $this->devisOfDefunt['configuration']->entreprise. ' habilitée sous le numéro ' . $this->devisOfDefunt['thanato_reference'] . ' certifie par '),0,1);
|
||||
$this->Cell(0,7,FileExportHelpers::FormatTextForExport('la présente que : '),0,1);
|
||||
$this->SetFont('Corsiva Bold', '', 14);
|
||||
$this->Cell(0,12, 'Mr/Mlle ' . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['thanato_nom'] . ' ' . $this->devisOfDefunt['thanato_prenom']),0,1);
|
||||
$this->SetFont('Corsiva', '', 14);
|
||||
$this->MultiCell(0,7, FileExportHelpers::FormatTextForExport('Employé au sein de notre société et titulaire du diplôme national de Thanatopracteur a effectué des soins de conservation sur le corps du défunt :'));
|
||||
$this->SetFont('Corsiva Bold', '', 14);
|
||||
$this->Cell(0,12, 'M./Mme '.$this->devisOfDefunt['defunt_nom'],0,1);
|
||||
$this->Cell(0,12, FileExportHelpers::FormatTextForExport("Qui reposait à l'adresse suivante"),0,1);
|
||||
$this->SetFont('Corsiva', '', 14);
|
||||
$this->Cell(0,12, FileExportHelpers::FormatTextForExport("Qui reposait à l'adresse suivante") . ': ',0,1);
|
||||
$this->SetFont('Corsiva Bold', '', 14);
|
||||
$this->Cell(0,12, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->adresse),0,1);
|
||||
$this->Cell(0,12, FileExportHelpers::FormatTextForExport("La présente attestion est établie pour faire valoir ce que de droit"),0,5);
|
||||
$this->SetFont('Corsiva', '', 14);
|
||||
$this->Cell(0,12, FileExportHelpers::FormatTextForExport("La présente attestion est établie pour faire valoir ce que de droit."),0,5);
|
||||
$this->Ln(5);
|
||||
$this->Cell(0,12,FileExportHelpers::FormatTextForExport('Fait à '). FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->adresse));
|
||||
$this->SetX(140);
|
||||
@ -90,7 +103,7 @@ class CareCertificatePdfHandler extends FPDF {
|
||||
|
||||
private function SetCareCertificateTitle(){
|
||||
$this->SetY(60);
|
||||
$this->SetFont('Arial', 'B', 17);
|
||||
$this->SetFont('Corsiva Bold', '', 20);
|
||||
$this->Cell(0, 10, 'ATTESTATION DE SOINS DE CONSERVATION', 0, 1,'C');
|
||||
$this->Ln(20);
|
||||
}
|
||||
|
||||
25
gestion/vendor/setasign/fpdf/font/Monotype-Corsiva-Bold.php
vendored
Normal file
25
gestion/vendor/setasign/fpdf/font/Monotype-Corsiva-Bold.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$type = 'TrueType';
|
||||
$name = 'Corsiva-Bold';
|
||||
$desc = array('Ascent'=>689,'Descent'=>-259,'CapHeight'=>637,'Flags'=>96,'FontBBox'=>'[-240 -307 1204 913]','ItalicAngle'=>-14,'StemV'=>120,'MissingWidth'=>750);
|
||||
$up = -120;
|
||||
$ut = 50;
|
||||
$cw = array(
|
||||
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
|
||||
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>220,'!'=>303,'"'=>227,'#'=>680,'$'=>466,'%'=>740,'&'=>817,'\''=>167,'('=>275,')'=>235,'*'=>437,'+'=>520,
|
||||
','=>235,'-'=>310,'.'=>236,'/'=>340,'0'=>470,'1'=>470,'2'=>470,'3'=>470,'4'=>470,'5'=>470,'6'=>470,'7'=>470,'8'=>470,'9'=>470,':'=>276,';'=>255,'<'=>520,'='=>520,'>'=>520,'?'=>406,'@'=>745,'A'=>650,
|
||||
'B'=>630,'C'=>540,'D'=>730,'E'=>630,'F'=>590,'G'=>650,'H'=>710,'I'=>410,'J'=>430,'K'=>690,'L'=>610,'M'=>875,'N'=>730,'O'=>640,'P'=>569,'Q'=>637,'R'=>619,'S'=>489,'T'=>530,'U'=>765,'V'=>668,'W'=>892,
|
||||
'X'=>587,'Y'=>590,'Z'=>620,'['=>270,'\\'=>480,']'=>350,'^'=>520,'_'=>500,'`'=>235,'a'=>459,'b'=>468,'c'=>370,'d'=>475,'e'=>379,'f'=>357,'g'=>440,'h'=>479,'i'=>252,'j'=>237,'k'=>469,'l'=>280,'m'=>679,
|
||||
'n'=>500,'o'=>418,'p'=>480,'q'=>440,'r'=>337,'s'=>350,'t'=>340,'u'=>498,'v'=>470,'w'=>722,'x'=>445,'y'=>424,'z'=>440,'{'=>270,'|'=>520,'}'=>240,'~'=>520,chr(127)=>750,chr(128)=>440,chr(129)=>750,chr(130)=>195,chr(131)=>440,
|
||||
chr(132)=>307,chr(133)=>1000,chr(134)=>460,chr(135)=>480,chr(136)=>340,chr(137)=>1055,chr(138)=>489,chr(139)=>260,chr(140)=>850,chr(141)=>750,chr(142)=>620,chr(143)=>750,chr(144)=>750,chr(145)=>255,chr(146)=>255,chr(147)=>368,chr(148)=>387,chr(149)=>600,chr(150)=>500,chr(151)=>1000,chr(152)=>460,chr(153)=>1000,
|
||||
chr(154)=>350,chr(155)=>280,chr(156)=>593,chr(157)=>750,chr(158)=>440,chr(159)=>590,chr(160)=>220,chr(161)=>303,chr(162)=>440,chr(163)=>511,chr(164)=>600,chr(165)=>750,chr(166)=>520,chr(167)=>420,chr(168)=>389,chr(169)=>740,chr(170)=>300,chr(171)=>370,chr(172)=>600,chr(173)=>310,chr(174)=>740,chr(175)=>452,
|
||||
chr(176)=>400,chr(177)=>549,chr(178)=>274,chr(179)=>284,chr(180)=>315,chr(181)=>500,chr(182)=>500,chr(183)=>236,chr(184)=>330,chr(185)=>284,chr(186)=>290,chr(187)=>410,chr(188)=>700,chr(189)=>700,chr(190)=>700,chr(191)=>426,chr(192)=>650,chr(193)=>650,chr(194)=>650,chr(195)=>650,chr(196)=>650,chr(197)=>650,
|
||||
chr(198)=>769,chr(199)=>540,chr(200)=>630,chr(201)=>630,chr(202)=>630,chr(203)=>630,chr(204)=>410,chr(205)=>410,chr(206)=>410,chr(207)=>410,chr(208)=>730,chr(209)=>730,chr(210)=>640,chr(211)=>640,chr(212)=>640,chr(213)=>640,chr(214)=>640,chr(215)=>520,chr(216)=>695,chr(217)=>765,chr(218)=>765,chr(219)=>765,
|
||||
chr(220)=>765,chr(221)=>590,chr(222)=>580,chr(223)=>450,chr(224)=>459,chr(225)=>459,chr(226)=>459,chr(227)=>459,chr(228)=>459,chr(229)=>459,chr(230)=>580,chr(231)=>370,chr(232)=>379,chr(233)=>379,chr(234)=>379,chr(235)=>379,chr(236)=>252,chr(237)=>252,chr(238)=>252,chr(239)=>252,chr(240)=>440,chr(241)=>500,
|
||||
chr(242)=>418,chr(243)=>418,chr(244)=>418,chr(245)=>418,chr(246)=>418,chr(247)=>549,chr(248)=>443,chr(249)=>498,chr(250)=>498,chr(251)=>498,chr(252)=>498,chr(253)=>424,chr(254)=>473,chr(255)=>424);
|
||||
$enc = 'cp1252';
|
||||
$uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
|
||||
$file = 'Monotype-Corsiva-Bold.z';
|
||||
$originalsize = 38992;
|
||||
$subsetted = true;
|
||||
?>
|
||||
BIN
gestion/vendor/setasign/fpdf/font/Monotype-Corsiva-Bold.z
vendored
Normal file
BIN
gestion/vendor/setasign/fpdf/font/Monotype-Corsiva-Bold.z
vendored
Normal file
Binary file not shown.
25
gestion/vendor/setasign/fpdf/font/Monotype-Corsiva-Regular.php
vendored
Normal file
25
gestion/vendor/setasign/fpdf/font/Monotype-Corsiva-Regular.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$type = 'TrueType';
|
||||
$name = 'Corsiva';
|
||||
$desc = array('Ascent'=>689,'Descent'=>-259,'CapHeight'=>689,'Flags'=>96,'FontBBox'=>'[-240 -307 1159 913]','ItalicAngle'=>-15,'StemV'=>70,'MissingWidth'=>750);
|
||||
$up = -120;
|
||||
$ut = 50;
|
||||
$cw = array(
|
||||
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
|
||||
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>220,'!'=>280,'"'=>220,'#'=>680,'$'=>440,'%'=>680,'&'=>780,'\''=>160,'('=>260,')'=>220,'*'=>420,'+'=>520,
|
||||
','=>220,'-'=>280,'.'=>220,'/'=>340,'0'=>440,'1'=>440,'2'=>440,'3'=>440,'4'=>440,'5'=>440,'6'=>440,'7'=>440,'8'=>440,'9'=>440,':'=>260,';'=>240,'<'=>520,'='=>520,'>'=>520,'?'=>380,'@'=>700,'A'=>620,
|
||||
'B'=>600,'C'=>520,'D'=>700,'E'=>620,'F'=>580,'G'=>620,'H'=>680,'I'=>380,'J'=>400,'K'=>660,'L'=>580,'M'=>840,'N'=>700,'O'=>600,'P'=>540,'Q'=>600,'R'=>600,'S'=>460,'T'=>500,'U'=>740,'V'=>640,'W'=>880,
|
||||
'X'=>560,'Y'=>560,'Z'=>620,'['=>240,'\\'=>480,']'=>320,'^'=>520,'_'=>500,'`'=>220,'a'=>420,'b'=>420,'c'=>340,'d'=>440,'e'=>340,'f'=>320,'g'=>400,'h'=>440,'i'=>240,'j'=>220,'k'=>440,'l'=>240,'m'=>620,
|
||||
'n'=>460,'o'=>400,'p'=>440,'q'=>400,'r'=>300,'s'=>320,'t'=>320,'u'=>460,'v'=>440,'w'=>680,'x'=>420,'y'=>400,'z'=>440,'{'=>240,'|'=>520,'}'=>240,'~'=>520,chr(127)=>750,chr(128)=>440,chr(129)=>750,chr(130)=>180,chr(131)=>400,
|
||||
chr(132)=>280,chr(133)=>1000,chr(134)=>460,chr(135)=>480,chr(136)=>340,chr(137)=>960,chr(138)=>460,chr(139)=>240,chr(140)=>820,chr(141)=>750,chr(142)=>620,chr(143)=>750,chr(144)=>750,chr(145)=>240,chr(146)=>240,chr(147)=>340,chr(148)=>360,chr(149)=>600,chr(150)=>500,chr(151)=>1000,chr(152)=>440,chr(153)=>1000,
|
||||
chr(154)=>320,chr(155)=>260,chr(156)=>560,chr(157)=>750,chr(158)=>440,chr(159)=>560,chr(160)=>220,chr(161)=>280,chr(162)=>440,chr(163)=>480,chr(164)=>600,chr(165)=>720,chr(166)=>520,chr(167)=>420,chr(168)=>360,chr(169)=>740,chr(170)=>260,chr(171)=>340,chr(172)=>600,chr(173)=>280,chr(174)=>740,chr(175)=>500,
|
||||
chr(176)=>400,chr(177)=>549,chr(178)=>264,chr(179)=>264,chr(180)=>300,chr(181)=>576,chr(182)=>500,chr(183)=>333,chr(184)=>300,chr(185)=>264,chr(186)=>260,chr(187)=>380,chr(188)=>660,chr(189)=>660,chr(190)=>660,chr(191)=>400,chr(192)=>620,chr(193)=>620,chr(194)=>620,chr(195)=>620,chr(196)=>620,chr(197)=>620,
|
||||
chr(198)=>740,chr(199)=>520,chr(200)=>620,chr(201)=>620,chr(202)=>620,chr(203)=>620,chr(204)=>380,chr(205)=>380,chr(206)=>380,chr(207)=>380,chr(208)=>700,chr(209)=>700,chr(210)=>600,chr(211)=>600,chr(212)=>600,chr(213)=>600,chr(214)=>600,chr(215)=>520,chr(216)=>660,chr(217)=>740,chr(218)=>740,chr(219)=>740,
|
||||
chr(220)=>740,chr(221)=>560,chr(222)=>540,chr(223)=>420,chr(224)=>420,chr(225)=>420,chr(226)=>420,chr(227)=>420,chr(228)=>420,chr(229)=>420,chr(230)=>540,chr(231)=>340,chr(232)=>340,chr(233)=>340,chr(234)=>340,chr(235)=>340,chr(236)=>240,chr(237)=>240,chr(238)=>240,chr(239)=>240,chr(240)=>400,chr(241)=>460,
|
||||
chr(242)=>400,chr(243)=>400,chr(244)=>400,chr(245)=>400,chr(246)=>400,chr(247)=>549,chr(248)=>440,chr(249)=>460,chr(250)=>460,chr(251)=>460,chr(252)=>460,chr(253)=>400,chr(254)=>440,chr(255)=>400);
|
||||
$enc = 'cp1252';
|
||||
$uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
|
||||
$file = 'Monotype-Corsiva-Regular.z';
|
||||
$originalsize = 58036;
|
||||
$subsetted = true;
|
||||
?>
|
||||
BIN
gestion/vendor/setasign/fpdf/font/Monotype-Corsiva-Regular.z
vendored
Normal file
BIN
gestion/vendor/setasign/fpdf/font/Monotype-Corsiva-Regular.z
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user