WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PageSetupImpl

    Show / Hide Table of Contents

    Class PageSetupImpl

    This Class allows the user to configure Print settings of a document.

    Inheritance
    System.Object
    CommonObject
    PageSetupBaseImpl
    PageSetupImpl
    Implements
    System.IDisposable
    IBiffStorage
    IPageSetup
    IPageSetupBase
    IParentApplication
    Inherited Members
    PageSetupBaseImpl.DEFAULT_TOPMARGIN
    PageSetupBaseImpl.DEFAULT_BOTTOMMARGIN
    PageSetupBaseImpl.DEFAULT_LEFTMARGIN
    PageSetupBaseImpl.DEFAULT_RIGHTMARGIN
    PageSetupBaseImpl.m_bHCenter
    PageSetupBaseImpl.m_bVCenter
    PageSetupBaseImpl.m_unknown
    PageSetupBaseImpl.m_setup
    PageSetupBaseImpl.m_dBottomMargin
    PageSetupBaseImpl.m_dLeftMargin
    PageSetupBaseImpl.m_dRightMargin
    PageSetupBaseImpl.m_dTopMargin
    PageSetupBaseImpl.m_arrHeaders
    PageSetupBaseImpl.m_arrFooters
    PageSetupBaseImpl.m_backgroundImage
    PageSetupBaseImpl.m_headerFooter
    PageSetupBaseImpl.ParseHeaderFooterString(String)
    PageSetupBaseImpl.CreateHeaderFooterString(String[])
    PageSetupBaseImpl.Serialize(OffsetArrayList)
    PageSetupBaseImpl.SerializeEndRecords(OffsetArrayList)
    PageSetupBaseImpl.Parse(IList<BiffRecordRaw>, Int32)
    PageSetupBaseImpl.GetOrCreateRecord(IList, Int32, TBIFFRecord)
    PageSetupBaseImpl.GetRecordUpdatePos(IList, Int32)
    PageSetupBaseImpl.GetRecordUpdatePos(IList, Int32, TBIFFRecord)
    PageSetupBaseImpl.SetChanged()
    PageSetupBaseImpl.FillStream(BinaryWriter, DataProvider, IEncryptor, Int32)
    PageSetupBaseImpl.WriteUShortRecord(BinaryWriter, DataProvider, IEncryptor, TBIFFRecord, UInt16, Int32)
    PageSetupBaseImpl.FillStreamEnd(BinaryWriter, DataProvider, IEncryptor, Int32)
    PageSetupBaseImpl.FitToPagesTall
    PageSetupBaseImpl.FitToPagesWide
    PageSetupBaseImpl.IsNotValidSettings
    PageSetupBaseImpl.AutoFirstPageNumber
    PageSetupBaseImpl.BlackAndWhite
    PageSetupBaseImpl.BottomMargin
    PageSetupBaseImpl.CenterFooter
    PageSetupBaseImpl.CenterFooterImage
    PageSetupBaseImpl.CenterHeaderImage
    PageSetupBaseImpl.CenterHeader
    PageSetupBaseImpl.CenterHorizontally
    PageSetupBaseImpl.CenterVertically
    PageSetupBaseImpl.Copies
    PageSetupBaseImpl.Draft
    PageSetupBaseImpl.FirstPageNumber
    PageSetupBaseImpl.FooterMargin
    PageSetupBaseImpl.HeaderMargin
    PageSetupBaseImpl.LeftFooter
    PageSetupBaseImpl.LeftHeader
    PageSetupBaseImpl.LeftFooterImage
    PageSetupBaseImpl.LeftHeaderImage
    PageSetupBaseImpl.LeftMargin
    PageSetupBaseImpl.Order
    PageSetupBaseImpl.Orientation
    PageSetupBaseImpl.PaperSize
    PageSetupBaseImpl.PrintComments
    PageSetupBaseImpl.PrintErrors
    PageSetupBaseImpl.PrintNotes
    PageSetupBaseImpl.PrintQuality
    PageSetupBaseImpl.RightFooter
    PageSetupBaseImpl.RightFooterImage
    PageSetupBaseImpl.RightHeader
    PageSetupBaseImpl.RightHeaderImage
    PageSetupBaseImpl.RightMargin
    PageSetupBaseImpl.TopMargin
    PageSetupBaseImpl.Zoom
    PageSetupBaseImpl.BackgoundImage
    PageSetupBaseImpl.PageWidth
    PageSetupBaseImpl.PageHeight
    PageSetupBaseImpl.HResolution
    PageSetupBaseImpl.VResolution
    PageSetupBaseImpl.EvenPage
    PageSetupBaseImpl.FirstPage
    PageSetupBaseImpl.FullHeaderString
    PageSetupBaseImpl.FullFooterString
    PageSetupBaseImpl.AlignHFWithPageMargins
    PageSetupBaseImpl.DifferentFirstPageHF
    PageSetupBaseImpl.DifferentOddAndEvenPagesHF
    PageSetupBaseImpl.HFScaleWithDoc
    PageSetupBaseImpl.TypeCode
    PageSetupBaseImpl.RecordCode
    PageSetupBaseImpl.NeedDataArray
    PageSetupBaseImpl.StreamPos
    CommonObject.m_bIsDisposed
    CommonObject.FindParent(Type)
    CommonObject.FindParent(Type, Boolean)
    CommonObject.FindParent(Object, Type)
    CommonObject.FindParent(Object, Type, Boolean)
    CommonObject.FindParents(Type[])
    CommonObject.FindParent(Type[])
    CommonObject.SetParent(Object)
    CommonObject.CheckDisposed()
    CommonObject.AddReference()
    CommonObject.ReleaseReference()
    CommonObject.OnDispose()
    CommonObject.Application
    CommonObject.Parent
    CommonObject.AppImplementation
    CommonObject.ReferenceCount
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.XlsIO.Implementation
    Assembly: Syncfusion.XlsIO.Base.dll
    Syntax
    public class PageSetupImpl : PageSetupBaseImpl, IDisposable, IBiffStorage, IPageSetup, IPageSetupBase, IParentApplication

    Constructors

    PageSetupImpl(IApplication, Object)

    Sets application and parent fields.

    Declaration
    public PageSetupImpl(IApplication application, object parent)
    Parameters
    Type Name Description
    IApplication application

    Application object for the page setup.

    System.Object parent

    Parent object for the page setup.

    PageSetupImpl(IApplication, Object, BiffRecordRaw[], Int32)

    Recovers Page setup from the Biff Records array starting from position

    Declaration
    [CLSCompliant(false)]
    public PageSetupImpl(IApplication application, object parent, BiffRecordRaw[] data, int position)
    Parameters
    Type Name Description
    IApplication application

    Application object for the page setup.

    System.Object parent

    Parent object for the page setup.

    Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw[] data

    Array of Biff Records that contains all needed records.

    System.Int32 position

    Position of PrintHeadersRecord in the array.

    PageSetupImpl(IApplication, Object, BiffReader)

    Recovers page setup from the stream and sets its Application and Parent fields. Current record in the stream must be PrintHeadersRecord.

    Declaration
    [CLSCompliant(false)]
    public PageSetupImpl(IApplication application, object parent, BiffReader reader)
    Parameters
    Type Name Description
    IApplication application

    Application object for the page setup.

    System.Object parent

    Parent object for the page setup.

    BiffReader reader

    BiffReader that contains page setup records.

    PageSetupImpl(IApplication, Object, List<BiffRecordRaw>, Int32)

    Recovers Page setup from the Biff Records List starting from position.

    Declaration
    public PageSetupImpl(IApplication application, object parent, List<BiffRecordRaw> data, int position)
    Parameters
    Type Name Description
    IApplication application

    Application object for the page setup.

    System.Object parent

    Parent object for the page setup.

    System.Collections.Generic.List<Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw> data

    List which contains Biff Records.

    System.Int32 position

    Position of PrintHeadersRecord in the array.

    Properties

    DefaultRowHeight

    Gets / sets default row height.

    Declaration
    public int DefaultRowHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    DefaultRowHeightFlag

    Gets / sets default row height option flag.

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

    HPageBreaks

    Gets horizontal page break.

    Declaration
    public HPageBreaksCollection HPageBreaks { get; }
    Property Value
    Type Description
    HPageBreaksCollection

    IsFitToPage

    Indicates whether fit to page mode is selected.

    Declaration
    public override bool IsFitToPage { get; set; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    PageSetupBaseImpl.IsFitToPage

    IsSummaryColumnRight

    Indicates whether summary columns will appear right of the detail in outlines.

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

    IsSummaryRowBelow

    Indicates whether summary rows will appear below detail in outlines.

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

    PrintArea

    Returns or sets the range to be printed, as a string using A1-style references in the language of the macro. Read/write String.

    Declaration
    public string PrintArea { get; set; }
    Property Value
    Type Description
    System.String

    PrintGridlines

    True if cell gridlines are printed on the page. Applies only to worksheets. Read/write Boolean.

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

    To know more about page settings refer this link.

    Examples

    The following code illustrates the use of PrintGridlines property.

          using (ExcelEngine excelEngine = new ExcelEngine())
          {
            //Create a worksheet.        
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet sheet = workbook.Worksheets[0];
            sheet.Range["A1:M20"].Text = "PagePrint";
            sheet.Range["A1:M1"].Text = "Page";
            sheet.Range["C1:C20"].Text = "Page";
    
            //True to cell gridlines are printed on the page
            sheet.PageSetup.PrintGridlines = true;
    
            workbook.SaveAs("PageSetup.xlsx");
            workbook.Close();
          }

    PrintHeadings

    True if row and column headings are printed with this page. Applies only to worksheets. Read/write Boolean.

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

    PrintTitleColumns

    Returns or sets the columns that contain the cells to be repeated on the left side of each page, as a string in A1-style notation in the language of the macro. Read/write String.

    Declaration
    public string PrintTitleColumns { get; set; }
    Property Value
    Type Description
    System.String

    PrintTitleRows

    Returns or sets the rows that contain the cells to be repeated at the top of each page, as a string in A1-style notation in the language of the macro. Read/write String.

    Declaration
    public string PrintTitleRows { get; set; }
    Property Value
    Type Description
    System.String

    RelationId

    Gets / sets relation id to the printer settings part.

    Declaration
    public string RelationId { get; set; }
    Property Value
    Type Description
    System.String

    VPageBreaks

    Gets vertical page break.

    Declaration
    public VPageBreaksCollection VPageBreaks { get; }
    Property Value
    Type Description
    VPageBreaksCollection

    Worksheet

    Returns parent worksheet. Read-only.

    Declaration
    public WorksheetImpl Worksheet { get; }
    Property Value
    Type Description
    WorksheetImpl

    Methods

    Clone(Object)

    Creates copy of the current instance.

    Declaration
    public PageSetupImpl Clone(object parent)
    Parameters
    Type Name Description
    System.Object parent

    Parent for the new instance.

    Returns
    Type Description
    PageSetupImpl

    A clone of the current instance.

    ConvertTo3dRangeName(String)

    Converts cell range to 3d Range name.

    Declaration
    protected string ConvertTo3dRangeName(string value)
    Parameters
    Type Name Description
    System.String value

    cell range.

    Returns
    Type Description
    System.String

    3d range name.

    Dispose()

    Dispose Page Setup

    Declaration
    public override void Dispose()
    Overrides
    PageSetupBaseImpl.Dispose()

    ExtractPrintArea()

    Extracts print area string.

    Declaration
    protected string ExtractPrintArea()
    Returns
    Type Description
    System.String

    Print area string.

    ExtractPrintTitleRowColumn(Boolean)

    Extracts row or column print title from default title named range.

    Declaration
    protected string ExtractPrintTitleRowColumn(bool bRowExtract)
    Parameters
    Type Name Description
    System.Boolean bRowExtract

    Defines which print title must be extracted.

    Returns
    Type Description
    System.String

    Row/column print title string.

    FillGutsRecord()

    Fills internal guts record with information from Rows and ColumnInfo records.

    Declaration
    protected void FillGutsRecord()

    FillStreamStart(BinaryWriter, DataProvider, IEncryptor, Int32)

    Fills stream with some records before main page setup records.

    Declaration
    protected override int FillStreamStart(BinaryWriter writer, DataProvider provider, IEncryptor encryptor, int streamPosition)
    Parameters
    Type Name Description
    System.IO.BinaryWriter writer

    Writer to write records into.

    DataProvider provider

    Object that gives access to the temporary buffer.

    IEncryptor encryptor

    Object to encrypt data.

    System.Int32 streamPosition

    Position in the output stream. Used to increase performance.

    Returns
    Type Description
    System.Int32

    Size of the serialized data.

    Overrides
    PageSetupBaseImpl.FillStreamStart(BinaryWriter, DataProvider, IEncryptor, Int32)

    FindParents()

    Find parent worksheet.

    Declaration
    protected override void FindParents()
    Overrides
    PageSetupBaseImpl.FindParents()
    Exceptions
    Type Condition
    System.ArgumentException

    When can't find parent worksheet.

    GetAddressGlobalWithoutName(Ptg[])

    Returns global address without sheet name.

    Declaration
    protected string GetAddressGlobalWithoutName(Ptg[] token)
    Parameters
    Type Name Description
    Ptg[] token

    Formula token.

    Returns
    Type Description
    System.String

    Global address without sheet name.

    GetStoreSize(ExcelVersion)

    Size of the required storage space. Read-only.

    Declaration
    public override int GetStoreSize(ExcelVersion version)
    Parameters
    Type Name Description
    ExcelVersion version

    Represents Excel version.

    Returns
    Type Description
    System.Int32
    Overrides
    PageSetupBaseImpl.GetStoreSize(ExcelVersion)

    Parse(BiffReader)

    Recovers page setup from the stream, first record must be PrintHeadersRecord.

    Declaration
    [CLSCompliant(false)]
    public void Parse(BiffReader reader)
    Parameters
    Type Name Description
    BiffReader reader

    Stream that contains all needed records.

    ParsePrintAreaExpression(String)

    Parses print area expression.

    Declaration
    protected void ParsePrintAreaExpression(string value)
    Parameters
    Type Name Description
    System.String value

    Value representing print area.

    ParsePrintTitleColumns(String)

    Parses column print title string and makes appropriate changes to default title named range.

    Declaration
    protected void ParsePrintTitleColumns(string value)
    Parameters
    Type Name Description
    System.String value

    Column print title string to set.

    ParsePrintTitleRows(String)

    Parses row print title string and makes appropriate changes to default title named range.

    Declaration
    protected void ParsePrintTitleRows(string value)
    Parameters
    Type Name Description
    System.String value

    Row print title string to set.

    ParseRecord(BiffRecordRaw)

    Parses record.

    Declaration
    [CLSCompliant(false)]
    protected override bool ParseRecord(BiffRecordRaw record)
    Parameters
    Type Name Description
    Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw record

    Record to parse.

    Returns
    Type Description
    System.Boolean

    True if record was successfully parsed, false otherwise.

    Overrides
    PageSetupBaseImpl.ParseRecord(BiffRecordRaw)

    SerializeStartRecords(OffsetArrayList)

    Serializes some records before main page setup block.

    Declaration
    [CLSCompliant(false)]
    protected override void SerializeStartRecords(OffsetArrayList records)
    Parameters
    Type Name Description
    OffsetArrayList records

    OffsetArrayList to serialize into.

    Overrides
    PageSetupBaseImpl.SerializeStartRecords(OffsetArrayList)

    Implements

    System.IDisposable
    IBiffStorage
    IPageSetup
    IPageSetupBase
    IParentApplication
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved