title: Symfony 5 convert xls to pdf PhpSpreadsheet
body: <p>i looked through a lot of examples on the internet, but didn’t find one that worked,
  found only how to convert html to pdf</p>
  <p>I would like to find a quick solution - from Excel directly to PDF format</p>
  <pre><code>    &lt;?php
       
      class PdfController extends AbstractController
      {
          public function getPdfFile($id)
          {
            // 
              $fileName = 'file.pdf';
              $temp_file = tempnam(sys_get_temp_dir(), $fileName);
              $writer = new Xlsx($spreadsheet);
      
              try {
                  $writer-&gt;save($temp_file);
              } catch (Exception $e) {
              }
  
              //and here i want convert my xls file to pdf
          }
  }
  </code></pre>
  <p>thank you for your answer</p>