ProjectGetPageCount Method (PageSize, Timescale, DateTime, DateTime)

Returns page count for the project to be rendered using given Timescale, PresentationFormat and date range.

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
public int GetPageCount(
	PageSize pageSize,
	Timescale scale,
	DateTime startDate,
	DateTime endDate
)

Parameters

pageSize
Type: Aspose.Tasks.VisualizationPageSize
The size to get page count for.
scale
Type: Aspose.Tasks.VisualizationTimescale
The scale to get page count for.
startDate
Type: SystemDateTime
The start date to get page count for.
endDate
Type: SystemDateTime
The end date to get page count for.

Return Value

Type: Int32
Page count to be rendered.
Examples
Shows how to get count of pages by page size, timescale, start and finish dates.
var project = new Project(DataDir + "GetNumberOfPages.mpp");
var pageCount = project.GetPageCount(
    PageSize.A3,
    Timescale.Months,
    project.Get(Prj.StartDate) - TimeSpan.FromDays(10),
    project.Get(Prj.FinishDate) + TimeSpan.FromDays(30));

Console.WriteLine(pageCount);
See Also