<?php
require_once __DIR__ . '/pdf/autoload.php';
// require_once '../ServiceLayer/CreateMarchandise.php';
//if($datajson!==null){
      $listData=json_decode($datajason);
      print_r($listData);
      //$mpdf = new \Mpdf\Mpdf();
      $mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8', 'format' => 'A2']);
      $stylesheet = file_get_contents('style.css');
      $mpdf->WriteHTML($stylesheet,\Mpdf\HTMLParserMode::HEADER_CSS);
      $name="<div class='firstD'><p class='static'>Client: ". 'C001023'."</p>
          <p class='static'>Date document: 01/06/2023</p>
      </div>";
      $article="<p class='static'>Article: ".'A000001'."</p>";
      $lot="<p class='static'>n°lot: ".'C001023-TEST2-220623-016'."</p>";
      $quantite="<p class='static'>Quantité: ".'1000'."</p>";
      $dateDex="<p class='static'>Date D'expiration	:".'22/06/2023'."</p>";
      $prix="<p class='static'>Nombre de palette: ".'20'.".00</p>";
      $mpdf->WriteHTML($name,\Mpdf\HTMLParserMode::HTML_BODY);
      $mpdf->WriteHTML($article,\Mpdf\HTMLParserMode::HTML_BODY);
      $mpdf->WriteHTML($lot,\Mpdf\HTMLParserMode::HTML_BODY);
      $mpdf->WriteHTML($quantite,\Mpdf\HTMLParserMode::HTML_BODY);
      $mpdf->WriteHTML($dateDex,\Mpdf\HTMLParserMode::HTML_BODY);
      $mpdf->WriteHTML($prix,\Mpdf\HTMLParserMode::HTML_BODY);
      $mpdf->Output(); 
// }else{
//     echo '<script>location.replace("../EntreeStock.php")</script>';
// }   
?>