Hi - I’m not sure if this is a limitation of the software; but when I convert a particular workbook (a .xlsx file) to PDF, I’m getting a result that is clipped on the right. The worksheet is very very wide - approximately 3 and 2/3 monitors wide on a standard 1080p monitor. It clips at just beyond 2 1/2 monitor widths.
Hi,
Thanks for your posting and using Aspose.Cells.
Please provide us your excel file that is getting clipped and also provide a screenshot highlighting the issue with red circles.
Please also download and try the latest version:
Aspose.Cells
for .NET v8.6.2.5
and see if it makes any difference and resolves your issue. Thanks for your cooperation.
Hi, Aspose:
Attached is an example of the problem. First open the XLSX and scroll all the way to the right. Notice the months go through July. Then open the resulting PDF and notice the original data is clipped starting at April. Here’s the code I use:
void ConvertExcelToPdf(string inputFilename, string outputFilename)
{
// reference Pdf|Documentation
var doc = new Aspose.Cells.Workbook(inputFilename);
foreach (Aspose.Cells.Worksheet sheet in doc.Worksheets)
{
var ps = sheet.PageSetup;
ps.TopMarginInch = ps.LeftMarginInch = ps.RightMarginInch = ps.BottomMarginInch = MarginForNonformattedFiles;
ps.Orientation = Aspose.Cells.PageOrientationType.Landscape;
ps.PaperSize = ExcelPaperSize;
}
try { doc.CalculateFormula(ignoreError: true); }
catch { }
doc.Save(outputFilename, Aspose.Cells.SaveFormat.Pdf);
}
MarginForNonformattedFiles = 0.5, and ExcelPaperSize is set to Aspose.Cells.PaperSizeType.PaperA2.
Hi,
worksheet.PageSetup.PrintArea = “”;