Class PdfSaveOptions

PdfSaveOptions class

Allows to specify additional options when rendering project pages to PDF.

public class PdfSaveOptions : SaveOptions

Constructors

NameDescription
PdfSaveOptions()Initializes a new instance of the PdfSaveOptions class that can be used to save a document in the PDF format.

Properties

NameDescription
BarStyles { get; set; }Gets or sets the list of the instances of the BarStyle class that appear in project view.
Compliance { get; set; }Gets or sets a desired compliance level for generated PDF document. Default is Pdf15.
CustomPageSize { get; set; }Gets or sets the custom page size in points (1 point = 1/72 of inch).
DigitalSignatureDetails { get; set; }Gets or sets a digital signature details. If not set, then no signing will be performed.
DrawNonWorkingTime { get; set; }Gets or sets a value indicating whether non-working time should be drawn (Default value is TRUE).
EncryptionDetails { get; set; }Gets or sets a encryption details. If not set, then no encryption will be performed.
EndDate { get; set; }Gets or sets a date to finish rendering to.
FitContent { get; set; }Gets or sets a value indicating whether row height should be increased to fit its content.
FitTimescaleToEndOfPage { get; set; }Gets or sets whether a calendar section of a view should be rendered to the end (right side) of the last page. If value is false, calendar section is rendered exactly to EndDate, even there is an empty space on a page.
FontSettings { get; }Specifies font settings used when rendering project’s view.
Gridlines { get; set; }Gets or sets a list of Gridline that appear in project view.
IsPortrait { get; set; }Gets or sets a value indicating whether the page orientation is portrait; returns false if the page orientation is landscape.
LegendDrawingOptions { get; set; }Gets or sets a value which define how to render a legend. Default value is LegendDrawingOptions.OnEveryPage.
MarkCriticalTasks { get; set; }Gets or sets a value indicating whether critical tasks should be displayed in red color (Default value is FALSE).
NonWorkingTimeColor { get; set; }Gets or sets the non-working time color.
PageCount { get; }Gets or sets the number of pages of project.
Pages { get; set; }Gets or sets the list of pages numbers to save when saving project layout to separate files. All pages will be saved if this list is empty.
PageSavingCallback { get; set; }Gets or sets a user-defined callback which is used to get an output stream for each rendered page. Is applicable when SaveToSeparateFiles option is used.
PageSize { get; set; }Gets or sets the size of page to be rendered (Default value is PageSize.A4).
PresentationFormat { get; set; }Gets or sets the PresentationFormat in which the document will be saved.
ReduceFooterGap { get; set; }Gets or sets a value indicating whether a gap between last task and the footer must be reduced.
RenderToSinglePage { get; set; }Gets or sets a value indicating whether a project should be rendered to a single page when project is saved in graphical format. The page size will be changed so the rendered project can be fit on one page.
RollUpGanttBars { get; set; }Gets or sets a value indicating whether subtasks on the summary task bar should be marked. For subtasks, the Rollup field indicates whether information on the subtask Gantt bars will be rolled up to the summary task bar. For summary tasks, the Rollup field indicates whether the summary task bar displays rolled up bars. You must have the Rollup field for summary tasks set to Yes for any subtasks to roll up to them.
SaveFormat { get; }Gets or sets the format in which the document will be saved if this save options object is used.
SaveToSeparateFiles { get; set; }Gets or sets a value indicating whether to save project pages to separate files.
StartDate { get; set; }Gets or sets the date to start rendering from.
TasksComparer { get; set; }Gets or sets the comparer to sort tasks on Gantt chart and Task Sheet chart.
TasksFilter { get; set; }Gets or sets the condition which is used to filter tasks rendered on Gantt, Task Sheet and Task Usage charts.
TextCompression { get; set; }Gets or sets a compression type to be used for all content streams except images. Default is Flate.
TextStyles { get; set; }Gets or sets the list of the instances of the TextStyle class that appear in project view.
Timescale { get; set; }Gets or sets the Timescale value which is used to control how timescale (if present) is rendered when project is saved to graphical format.
virtual UseGradientBrush { get; set; }Gets or sets a value indicating whether gradient brush should be used when rendering Gantt Chart.
View { get; set; }Gets or sets a list of the view columns to render (GanttChartColumn). If not set then task ids, task names, start and finish are rendered only. If both View and ViewSettings properties are set, columns from View overrides columns from ViewSettings.
ViewSettings { get; set; }Gets or sets a view (View) to render. You can use this options to explicitly specify which view should be saved to PDF, HTML or Image formats. If this property is set, PresentationFormat property is ignored when project is saved. View should be from one of the following screen ((Screen)): (Gantt, TaskSheet, TaskUsage, ResourceSheet, ResourceUsage)

Examples

Shows how to save selected pages of a project into PDF file.

var project = new Project(DataDir + "Software Development Plan.mpp");
var options = new PdfSaveOptions();
options.RenderToSinglePage = false;
options.Pages = new List<int>();

// lets check the number of pages can be exported
Console.WriteLine("Page Count: " + options.PageCount);

options.Pages.Add(1);
options.Pages.Add(4);
project.Save(OutDir + "SaveToMultiplePDFFiles_out.pdf", options);

See Also