title: How to save Excel File as PDF and fit to page
body: <p>i have a task to create function to export Excel file into PDF with requirements that all columns must fit in 1 page . </p>
  
  <p>This is the code i use to convert excel file to pdf.</p>
  
  <pre><code>xlApp = new Excel.Application();
  xlWb = xlApp.Workbooks.Open(textBox3.Text);
  xlWb.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, Path.GetDirectoryName(textBox3.Text)+ "\\" + Path.GetFileNameWithoutExtension(textBox3.Text) + ".pdf");
  </code></pre>
  
  <p>But when i open it , it appears that the columns is separated, like if i have like 10 columns , it will split like the first 6 columns in the first page and the last 4 columns in the second page.</p>
  
  <p>How to make it fit to page? it is okay if the potrait is landscape too</p>