Convert PDF after less three sets of data.
Aspose.Cells Ver :8.2.2.0
Code:
var sourceFilePath = textBox1.Text;
var ext = Path.GetExtension(sourceFilePath);
var pdfFilePath = sourceFilePath.Replace(ext, “.pdf”);
var lic = new Aspose.Cells.License();
lic.SetLicense(“Aspose.Total.lic”);
var excel = new Aspose.Cells.Workbook(sourceFilePath);
try
{
if (excel.Worksheets.Count > 0)
for (var n = 0; n < excel.Worksheets.Count; n++)
{
var sheet = excel.Worksheets[n];
if (sheet == null) continue;
sheet.PageSetup.Zoom = 100;
sheet.PageSetup.Orientation = Aspose.Cells.PageOrientationType.Portrait;
sheet.PageSetup.FitToPagesTall = 0;
sheet.PageSetup.FitToPagesWide = 1;
}
excel.Save(pdfFilePath, Aspose.Cells.SaveFormat.Pdf);
}
catch { }