menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DiagramExportSettings - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DiagramExportSettings

    Represents the configuration settings for exporting the diagram to various formats including PDF, PNG, JPEG, and SVG.

    Inheritance
    System.Object
    DiagramExportSettings
    Implements
    IDiagramPrintExportSettings
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DiagramExportSettings : Object, IDiagramPrintExportSettings
    Remarks

    Allowing customization of page layout, file format, and multi-page handling.

    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<string[]> OnExportEntry()
       {
         DiagramExportSettings print = new DiagramExportSettings();
         print.PageHeight = PageHeight;
         print.PageWidth = PageWidth;
         print.Orientation = orientation;
       }

    Constructors

    DiagramExportSettings()

    Declaration
    public DiagramExportSettings()

    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)

    Remarks

    Defines the custom area for export when using ClipBounds region mode.

    Examples
     <SfDiagramComponent>
    <PageSettings />
    </SfDiagramComponent>
    @code
    {
       private async Task<string[]> OnExportEntry()
       {
         DiagramExportSettings print = new DiagramExportSettings();
         print.ClipBounds = new DiagramRect() { X = 100, Y = 0, Width = 500, Height = 600 };
       }

    FitToPage

    Gets or sets a value indicating whether to fit the entire diagram to a single page during export operations.

    Declaration
    public bool FitToPage { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value is false.

    Remarks

    When true, the diagram is scaled to fit on a single page, potentially reducing element size.

    When false, the diagram maintains original scale and may span multiple pages.

    Examples
    <SfDiagramComponent>
    <PageSettings />
    </SfDiagramComponent>
    @code
    {
       private async Task<string[]> OnExportEntry()
       {
         DiagramExportSettings export = new DiagramExportSettings();
         export.FitToPage = true;
       }

    Margin

    Gets or sets the margin of the page to be exported.

    Declaration
    public DiagramThickness Margin { get; set; }
    Property Value
    Type Description
    DiagramThickness

    Space around the content to be exported.The default value for margin is 25 for all sides.

    Remarks

    The margin adds space between the diagram and the page edges.

    Examples
     <SfDiagramComponent>
    <PageSettings />
    </SfDiagramComponent>
    @code
    {
       private async Task<string[]> OnExportEntry()
       {
         DiagramExportSettings export = new DiagramExportSettings();
         export.Margin = new DiagramThickness() { Left = 10, Top = 10, Right = 10, Bottom = 10 };
       }

    Orientation

    Gets or sets the orientation of the page to be exported.

    Declaration
    public PageOrientation Orientation { get; set; }
    Property Value
    Type Description
    PageOrientation

    One of the PageOrientation enumeration values. The default value is Landscape.

    Remarks

    Determines the page orientation for diagram export. Landscape is preferred for wide diagrams, portrait for tall diagrams.

    Examples
    <SfDiagramComponent>
    <PageSettings  Orientation="@pageOrientation"/>
    </SfDiagramComponent>
    @code
    {
        PageOrientation pageOrientation = PageOrientation.Landscape;
       private async Task<string[]> OnExportEntry()
       {
         DiagramExportSettings export = new DiagramExportSettings();
         export.Orientation = orientation;
       }

    PageHeight

    Gets or sets the height of the page to be exported.

    Declaration
    public double PageHeight { get; set; }
    Property Value
    Type Description
    System.Double

    The height of the page in pixels. The default value inherits from Height.

    Remarks

    Controls the vertical dimension of the exported page. Overrides the default PageSettings height when set.

    Examples
     <SfDiagramComponent>
    <PageSettings  Height="@PageHeight" 
    </SfDiagramComponent>
    @code
    {
        double PageHeight = 300;
       private async Task<string[]> OnExportEntry()
       {
         DiagramExportSettings export = new DiagramExportSettings();
         export.PageHeight = PageHeight;
       }

    PageWidth

    Gets or sets the width of the page to be exported.

    Declaration
    public double PageWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The width of the page to be exported. The default value will be Width.

    Remarks

    Controls the horizontal dimension of the exported diagram page. Overrides the default PageSettings width during export operations.

    Examples
     <SfDiagramComponent>
    <PageSettings Width = "@PageWidth" />
    </SfDiagramComponent>
    @code
    {
        double PageWidth = 300;
       private async Task<string[]> OnExportEntry()
       {
         DiagramExportSettings export = new DiagramExportSettings();
         export.PageWidth = PageWidth;
       }

    Region

    Gets or sets the region in the diagram which need to be 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 exported.

    Content – Content of the diagram without empty space around the content is exported.

    ClipBounds - The region specified using ClipBounds property is exported. This is applicable for exporting only.

    Examples
    <SfDiagramComponent>
    <PageSettings />
    </SfDiagramComponent>
    @code
    {
       private async Task<string[]> OnExportEntry()
       {
         DiagramExportSettings export = new DiagramExportSettings();
         export.Region = DiagramPrintExportRegion.PageSettings;
       }

    Implements

    IDiagramPrintExportSettings
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved