title: Convert .xls to .pdf using LibreOffice via Command Line
body: <p>I'm trying to convert a <code>.xls</code> file to <code>.pdf</code> using LibreOffice via command line on Ubuntu. I have a kind of report on the <code>.xls</code> file with some colors in the background of the cells and etc.</p>
  
  <p>The problem is when I convert the <code>.xls</code> file, the <code>.pdf</code> loses the original format. Each page is broken almost in the half and the content of one page is displayed in two different pages.</p>
  
  <ul>
  <li>Does anybody know how to convert the <code>.xls</code> file to <code>.pdf</code> via command line with keeping the original format? </li>
  <li>Or some trick to set the size of the <code>.pdf</code> page to not break pages? (Also via command line)</li>
  </ul>
  
  <p>The code I used to make the conversion was: </p>
  
  <pre><code>soffice --headless --convert-to pdf:"impress_pdf_Export" filename.xls
  </code></pre>