Class DiagramPrintSettings
Represents the configuration settings for printing the diagram.
Inheritance
Implements
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class DiagramPrintSettings : Object, IDiagramPrintExportSettings
Examples
<SfDiagramComponent>
<PageSettings Width = "@PageWidth" Height="@PageHeight" Orientation="@pageOrientation" MultiplePage="@IsMultiplePage" ShowPageBreaks="@IsShowPageBreaks" />
</SfDiagramComponent>
@code
{
double PageWidth = 300;
double PageHeight = 300;
PageOrientation pageOrientation = PageOrientation.Landscape;
bool IsMultiplePage = true;
bool IsShowPageBreaks = true;
private async Task OnCustomEntry()
{
DiagramPrintSettings print = new DiagramPrintSettings();
print.FitToPage = true;
print.PageHeight = PageHeight;
print.PageWidth = PageWidth;
print.Orientation = orientation;
print.Region = DiagramPrintExportRegion.PageSettings;
print.Margin = new DiagramThickness() { Left = left, Top = top, Right = right, Bottom = bottom };
}
Constructors
DiagramPrintSettings()
Declaration
public DiagramPrintSettings()
Properties
ClipBounds
Gets or sets the region that to be exported when Region is ClipBounds.
Declaration
public DiagramRect ClipBounds { get; set; }
Property Value
Type | Description |
---|---|
DiagramRect | The bounds to be used for clipping area sizing. The default is a DiagramRect(0,0,0,0) |
Examples
<SfDiagramComponent>
<PageSettings />
</SfDiagramComponent>
@code
{
private async Task OnCustomEntry()
{
DiagramPrintSettings print = new DiagramPrintSettings();
print.ClipBounds = new DiagramRect() { X = 100, Y = 0, Width = 500, Height = 600 };
}
FitToPage
Gets or sets the value to indicate whether to print or export the entire diagram to single page or multiple pages.
Declaration
public bool FitToPage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true, if the diagram printed or exported to single page. Otherwise, diagram printed or exported into multiple pages or images. The default value is false. |
Examples
<SfDiagramComponent>
<PageSettings />
</SfDiagramComponent>
@code
{
private async Task OnCustomEntry()
{
DiagramPrintSettings print = new DiagramPrintSettings();
print.FitToPage = true;
}
Margin
Gets or sets the margin of the page to be printed/exported.
Declaration
public DiagramThickness Margin { get; set; }
Property Value
Type | Description |
---|---|
DiagramThickness | Space around the content to be printed/exported.The default value for margin is 25 for all sides. |
Examples
<SfDiagramComponent>
<PageSettings />
</SfDiagramComponent>
@code
{
private async Task OnCustomEntry()
{
DiagramPrintSettings print = new DiagramPrintSettings();
print.Margin = new DiagramThickness() { Left = left, Top = top, Right = right, Bottom = bottom };
}
Orientation
Gets or sets the orientation of the page to be printed.
Declaration
public PageOrientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
PageOrientation | One of the PageOrientation enumeration values. The default value is Landscape. |
Examples
<SfDiagramComponent>
<PageSettings Orientation="@pageOrientation" />
</SfDiagramComponent>
@code
{
PageOrientation pageOrientation = PageOrientation.Landscape;
private async Task OnCustomEntry()
{
DiagramPrintSettings print = new DiagramPrintSettings();
print.Orientation = orientation;
}
PageHeight
Gets or sets the height of the page to be printed.
Declaration
public double PageHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of the page to be printed. The default value will be Height. |
Examples
<SfDiagramComponent>
<PageSettings Height="@PageHeight" />
</SfDiagramComponent>
@code
{
double PageHeight = 300;
private async Task OnCustomEntry()
{
DiagramPrintSettings print = new DiagramPrintSettings();
print.PageHeight = PageHeight;
}
PageWidth
Gets or sets the width of the page to be printed.
Declaration
public double PageWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The width of the page to be printed. The default value will be Width. |
Examples
<SfDiagramComponent>
<PageSettings Width = "@PageWidth" />
</SfDiagramComponent>
@code
{
double PageWidth = 300;
private async Task OnCustomEntry()
{
DiagramPrintSettings print = new DiagramPrintSettings();
print.PageWidth = PageWidth;
}
Region
Gets or sets the region in the diagram which need to be printed or exported.
Declaration
public DiagramPrintExportRegion Region { get; set; }
Property Value
Type | Description |
---|---|
DiagramPrintExportRegion | One of the DiagramPrintExportRegion enumeration values. The default value is PageSettings |
Remarks
- PageSettings - The region within the x,y, width and height values of page settings is printed or exported.
- Content – Content of the diagram without empty space around the content is printed or exported.
- ClipBounds - The region specified using ClipBounds property is exported. This is applicable for exporting only.
Examples
</SfDiagramComponent>
<PageSettings />
</SfDiagramComponent>
@code
{
private async Task OnCustomEntry()
{
DiagramPrintSettings print = new DiagramPrintSettings();
print.Region = DiagramPrintExportRegion.PageSettings;
}