Table of Contents

Class XlsxDocumentPageSetup

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

How a sheet of an opened workbook says it is printed: paper, orientation, margins, scaling, what is printed and where the pages break. Read from PageSetup.

public sealed class XlsxDocumentPageSetup
Inheritance
XlsxDocumentPageSetup
Inherited Members

Remarks

Every member has Excel's own default when the sheet says nothing: Letter paper upright, margins of 0.7 inch at the sides and 0.75 inch above and below, header and footer 0.3 inch from the edge, 100 per cent, down then over, no gridlines, no headings.

This is what the file states, read once. It is not the settable page setup of a workbook that is being generated, which is XlsxPageSetup.

Properties

BlackAndWhite

Gets whether colours are printed as black and white.

BottomMarginInches

Gets the bottom margin in inches.

CenterHorizontally

Gets whether the printed cells are centred between the left and right margins.

CenterVertically

Gets whether the printed cells are centred between the top and bottom margins.

ColumnBreaks

Gets the columns after which a page break was set by hand, ascending: 3 means a new page starts at column D.

DifferentFirst

Gets whether the first page has its own header and footer.

DifferentOddEven

Gets whether even pages have their own header and footer.

Draft

Gets whether the sheet is printed in draft quality.

EvenFooter

Gets the footer of even pages, used when DifferentOddEven is set. Empty when there is none.

EvenHeader

Gets the header of even pages, used when DifferentOddEven is set. Empty when there is none.

FirstFooter

Gets the footer of the first page, used when DifferentFirst is set. Empty when there is none.

FirstHeader

Gets the header of the first page, used when DifferentFirst is set. Empty when there is none.

FirstPageNumber

Gets the number of the first page, or null when the sheet does not set one and numbering starts at 1.

FirstTitleColumn

Gets the first column repeated at the left of every page; 0 when none is.

FirstTitleRow

Gets the first row repeated at the top of every page; 0 when none is.

FitToHeight

Gets the number of pages down the sheet is fitted to; 0 for as many as it takes.

FitToPage

Gets whether the sheet is scaled to fit a number of pages (FitToWidth by FitToHeight) and not by Scale.

FitToWidth

Gets the number of pages across the sheet is fitted to; 0 for as many as it takes.

FooterMarginInches

Gets the distance of the footer from the bottom edge of the paper, in inches.

HeaderMarginInches

Gets the distance of the header from the top edge of the paper, in inches.

Landscape

Gets whether the page is turned on its side.

LastTitleColumn

Gets the last column repeated at the left of every page; 0 when none is.

LastTitleRow

Gets the last row repeated at the top of every page; 0 when none is.

LeftMarginInches

Gets the left margin in inches.

OddFooter

Gets the footer of odd pages, in the notation of OddHeader. Empty when there is none.

OddHeader

Gets the header of odd pages (of every page unless DifferentOddEven is set), in Excel's own notation: &L, &C and &R start the left, centre and right parts, and &P is the page number. Empty when there is none.

PageOrder

Gets the order the pages are printed in.

PaperSize

Gets the paper, as the number Windows gives it (DMPAPER_): 1 Letter, 5 Legal, 8 A3, 9 A4, 11 A5, and so on. 1 when the sheet names none.

PrintAreas

Gets the ranges that are printed, in the order the workbook names them; empty when the sheet has no print area and everything it uses is printed.

PrintGridlines

Gets whether the grid between the cells is printed.

PrintHeadings

Gets whether the row numbers and column letters are printed.

RightMarginInches

Gets the right margin in inches.

RowBreaks

Gets the rows after which a page break was set by hand, ascending: 5 means a new page starts at row 6.

Scale

Gets the scale the sheet is printed at, in per cent, 10 to 400. Not used when FitToPage is set.

TopMarginInches

Gets the top margin in inches.

Methods

ComposeHeaderFooter(string?, string?, string?)

Returns a header or footer of three parts in Excel's notation: &L, &C and &R before each part that is not empty. Each part is already in the notation (escape plain text with EscapeHeaderFooterText(string)).

EscapeHeaderFooterText(string)

Returns text for a header or footer with every & doubled, so that Excel shows it as written rather than reading it as a code (&P is the page number; && is an ampersand).

SetPrintTitleColumns(int, int)

Sets the columns repeated at the left of each page; 0 and 0 for none.

SetPrintTitleRows(int, int)

Sets the rows repeated at the top of each page (Excel's Print Titles, rows to repeat at top); 0 and 0 for none.