PageSettings

PageSettings class

Represents printing settings for a page of project view.

public class PageSettings

Constructors

NameDescription
PageSettings()Initializes a new instance of the PageSettings class. Represents printing settings for a page of project view.

Properties

NameDescription
AdjustToPercentOfNormalSize { get; set; }Gets or sets a value indicating whether to adjust printing to the specified percentage (PercentOfNormalSize) of normal size.
FirstPageNumber { get; set; }Gets or sets a first page number for printing.
IsPortrait { get; set; }Gets or sets a value indicating whether the page orientation is portrait; returns false if the page orientation is landscape.
PagesInHeight { get; set; }Gets or sets a number of pages in height to be printed.
PagesInWidth { get; set; }Gets or sets a number of pages in width to be printed.
PaperSize { get; set; }Gets or sets a paper size. Can be one of the values of the PrinterPaperSize enumeration.
PaperSizeId { get; set; }Gets or sets an integer representing one of the PrinterPaperSize values or a custom page size id. This value can be used to get PaperSize from OS settings .
PercentOfNormalSize { get; set; }Gets or sets a percentage of normal size to adjust printing to.

Examples

Shows how to work with <see cref=“Aspose.Tasks.Visualization.PageSettings” />.

var project = new Project(DataDir + "Project2.mpp");

// get the settings
var settings = project.DefaultView.PageInfo.PageSettings;
// lets tune some properties
// set a value indicating whether the page orientation is portrait; returns false if the page orientation is landscape.
settings.IsPortrait = true;
// set a number of pages in width to be printed.
settings.PagesInWidth = 5;
// set a number of pages in height to be printed.
settings.PagesInHeight = 7;
// set a percentage of normal size to adjust printing to.
settings.PercentOfNormalSize = 200;
// set a paper size. Can be one of the values of the <see cref="T:Aspose.Tasks.Visualization.PrinterPaperSize" /> enumeration.
settings.PaperSize = PrinterPaperSize.PaperB4;
// set a first page number for printing.
settings.FirstPageNumber = 3;

SimpleSaveOptions options = new MPPSaveOptions
{
    WriteViewData = true
};

project.Save(OutDir + "TestCanWritePageSettings.mpp", options);

See Also