title: Convert XLSX to PDF on one page by Spire.Pdf (c#)
body: <p>I have one page XLSX work sheet (invoice). I need to convert it to one page PDF document. For it I am using Spire library. But it covert my document to two pages. </p>
  
  <p>Code:</p>
  
  <pre><code>using (ExcelPackage xlPackageRef = new ExcelPackage(totalXlsFile))
  {
      using (ExcelPackage xlPackage = new ExcelPackage(workXlsFile))
      {
          ExcelWorkbook wb = xlPackage.Workbook;
          ExcelWorkbook wbRef = xlPackageRef.Workbook;
          var sheetName = invoice.XlsSeznamFakturNazevListu;
          OfficeOpenXml.ExcelWorksheet wsRef = wbRef.Worksheets[sheetName];
          if (wsRef != null)
          {
              // create xls work file
              wb.Worksheets.Add("faktura", wsRef);
              xlPackage.Save();
  
              // load Excel file
              Workbook workbook = new Workbook();
              workbook.LoadFromFile(workXlsFilePath);
  
              // pdf file path
              FileInfo pdfInvoiceFile = new FileInfo(pdfInvoiceTargetFolder + @"/" + pdfInvoiceFileName);
              if (pdfInvoiceFile.Exists)
                  pdfInvoiceFile.Delete();
  
              // create pdf file
              workbook.SaveToFile(pdfInvoiceFile.FullName, Spire.Xls.FileFormat.PDF);
          }
      }
  }
  </code></pre>