In aspose.Cell, i can set PageSize by below code.
sheet.PageSetup.PaperSize = Aspose.Cells.PaperSizeType.PaperA3;
In aspose.Cell, i can set PageSize by below code.
sheet.PageSetup.PaperSize = Aspose.Cells.PaperSizeType.PaperA3;
Hi,
Thanks for your posting and considering Aspose.Cells.
We are afraid, you cannot set custom page size by specifying your own width and height. This feature is not available both in MS-Excel and Aspose.Cells.
You will have to set default page sizes defined by Aspose.Cells.PaperSizeType.
Hi,
Hi Varun,
Hi, I wrongly entered data,
Hi Varun,
Thanks for considering Aspose APIs.
Please use the Worksheet.PageSetup.CustomPaperSize() method with the most recent version i.e. 17.11.6 for your needs. Please see the following code, its output Pdf and screenshot for a reference.
output-5x6-inches.zip (9.7 KB)
C#
//Create workbook
Workbook wb = new Workbook();
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Write some data in cell B4
ws.Cells["B4"].PutValue("This is sample data.");
//Set custom paper size, it is 5 x 6 inches
ws.PageSetup.CustomPaperSize(5, 6);
//Save it as pdf
wb.Save("output-5x6-inches.pdf");