Read out Page-borders

I want to create a Worksheet to print it. I used the PageSetup-class to set a page Format and now i want to now which range/cells are inside one Page. Is it possible to read out the range of one site?

@rkunschke,

Thanks for your query.

Yes, it is possible. We will share the code segment to accomplish the task.

We will get back to you soon.

@rkunschke,

See the sample code segment for your reference:
e.g
Sample code:

Workbook workbook = new Workbook("f:\\files\\book1.xlsx");
		Worksheet worksheet = workbook.getWorksheets().get(0);
		ImageOrPrintOptions printoption = new ImageOrPrintOptions();
		printoption.setPrintingPage(PrintingPageType.DEFAULT);
		SheetRender sr = new SheetRender(worksheet, printoption);
		int pageCount = sr.getPageCount();
		System.out.println(pageCount);
		CellArea [] area = worksheet.getPrintingPageBreaks(printoption);
		System.out.println(area.length);
		for(int i =0 ;i<area.length;i++)
		{
		      //Get each page range/area.
		      int strow = area[i].StartRow;
		      int stcol = area[i].StartColumn;

		      int erow = area[i].EndRow;
		      int ecols = area[i].EndColumn;
 System.out.println("Page " + (i + 1).toString() + " starts at: " + CellsHelper.cellIndexToName(strow, stcol));
                  //Your code goes here.
                  //..........

		} 
............

Hope, this helps a bit.

Thank you! this was what i am looking for.
I now discovered the setFitToPagesTall() and setFitToPagesWide() Methods.
But they only Fit content which is too large for one side.
Is it possible to fit pages which are smaller or less wide than the page?

@rkunschke,

Well, Aspose.Cells follows MS Excel standards and cannot go beyond it. These methods works the same way as MS Excel does when using Page Setup|Fit to Pages Tall/Wide, see the screenshot for your reference:

If you see anything different or any MS Excel option is not supported , let us know with details, sample and screenshot, we will check it soon.

Its seems to be the same in excel and aspose.
But i am a bit confused with the setFitToPagesWide() and setFitToPagesTall() method. For me it looks like theyre swaped. Or is it like it should be?

@rkunschke,

Could you share sample code and template file to show the issue, we will check it soon.

I read everything and it looks like it is like in excel. Thank you for youre help.

@rkunschke,

Good to know that it is sorted out now.