Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
PhpOffice\PhpSpreadsheet\Worksheet\PageSetup Class Reference

Public Member Functions

 __construct ()
 Create a new PageSetup.
 
 addPrintArea (string $value, int $index=-1)
 Add a new print area (e.g.
 
 addPrintAreaByColumnAndRow (int $column1, int $row1, int $column2, int $row2, int $index=-1)
 Add a new print area to the list of print areas.
 
 clearPrintArea (int $index=0)
 Clear a print area.
 
 getColumnsToRepeatAtLeft ()
 Get Columns to repeat at left.
 
 getFirstPageNumber ()
 Get first page number.
 
 getFitToHeight ()
 Get Fit To Height.
 
 getFitToPage ()
 Get Fit To Page.
 
 getFitToWidth ()
 Get Fit To Width.
 
 getHorizontalCentered ()
 Get center page horizontally.
 
 getOrientation ()
 Get Orientation.
 
 getPageOrder ()
 
 getPaperSize ()
 Get Paper Size.
 
 getPrintArea (int $index=0)
 Get print area.
 
 getRowsToRepeatAtTop ()
 Get Rows to repeat at top.
 
 getScale ()
 Get Scale.
 
 getVerticalCentered ()
 Get center page vertically.
 
 isColumnsToRepeatAtLeftSet ()
 Is Columns to repeat at left set?
 
 isPrintAreaSet (int $index=0)
 Is print area set?
 
 isRowsToRepeatAtTopSet ()
 Is Rows to repeat at top set?
 
 resetFirstPageNumber ()
 Reset first page number.
 
 setColumnsToRepeatAtLeft (array $columnsToRepeatAtLeft)
 Set Columns to repeat at left.
 
 setColumnsToRepeatAtLeftByStartAndEnd (string $start, string $end)
 Set Columns to repeat at left by start and end.
 
 setFirstPageNumber (?int $value)
 Set first page number.
 
 setFitToHeight (?int $fitToHeight, bool $update=true)
 Set Fit To Height.
 
 setFitToPage (bool $fitToPage)
 Set Fit To Page.
 
 setFitToWidth (?int $value, bool $update=true)
 Set Fit To Width.
 
 setHorizontalCentered (bool $value)
 Set center page horizontally.
 
 setOrientation (string $orientation)
 Set Orientation.
 
 setPageOrder (?string $pageOrder)
 
 setPaperSize (int $paperSize)
 Set Paper Size.
 
 setPrintArea (string $value, int $index=0, string $method=self::SETPRINTRANGE_OVERWRITE)
 Set print area.
 
 setPrintAreaByColumnAndRow (int $column1, int $row1, int $column2, int $row2, int $index=0, string $method=self::SETPRINTRANGE_OVERWRITE)
 Set print area.
 
 setRowsToRepeatAtTop (array $rowsToRepeatAtTop)
 Set Rows to repeat at top.
 
 setRowsToRepeatAtTopByStartAndEnd (int $start, int $end)
 Set Rows to repeat at top by start and end.
 
 setScale (?int $scale, bool $update=true)
 Set Scale.
 
 setVerticalCentered (bool $value)
 Set center page vertically.
 

Static Public Member Functions

static getOrientationDefault ()
 
static getPaperSizeDefault ()
 Get Paper Size default.
 
static setOrientationDefault (string $orientation)
 
static setPaperSizeDefault (int $paperSize)
 Set Paper Size Default.
 

Public Attributes

const ORIENTATION_DEFAULT = 'default'
 
const ORIENTATION_LANDSCAPE = 'landscape'
 
const ORIENTATION_PORTRAIT = 'portrait'
 
const PAGEORDER_DOWN_THEN_OVER = 'downThenOver'
 
const PAGEORDER_OVER_THEN_DOWN = 'overThenDown'
 
const PAPERSIZE_6_3_4_ENVELOPE = 38
 
const PAPERSIZE_A2_PAPER = 64
 
const PAPERSIZE_A3 = 8
 
const PAPERSIZE_A3_EXTRA_PAPER = 61
 
const PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER = 66
 
const PAPERSIZE_A3_TRANSVERSE_PAPER = 65
 
const PAPERSIZE_A4 = 9
 
const PAPERSIZE_A4_EXTRA_PAPER = 51
 
const PAPERSIZE_A4_PLUS_PAPER = 58
 
const PAPERSIZE_A4_SMALL = 10
 
const PAPERSIZE_A4_TRANSVERSE_PAPER = 53
 
const PAPERSIZE_A5 = 11
 
const PAPERSIZE_A5_EXTRA_PAPER = 62
 
const PAPERSIZE_A5_TRANSVERSE_PAPER = 59
 
const PAPERSIZE_B4 = 12
 
const PAPERSIZE_B4_ENVELOPE = 33
 
const PAPERSIZE_B5 = 13
 
const PAPERSIZE_B5_ENVELOPE = 34
 
const PAPERSIZE_B6_ENVELOPE = 35
 
const PAPERSIZE_C = 24
 
const PAPERSIZE_C3_ENVELOPE = 29
 
const PAPERSIZE_C4_ENVELOPE = 30
 
const PAPERSIZE_C5_ENVELOPE = 28
 
const PAPERSIZE_C65_ENVELOPE = 32
 
const PAPERSIZE_C6_ENVELOPE = 31
 
const PAPERSIZE_D = 25
 
const PAPERSIZE_DL_ENVELOPE = 27
 
const PAPERSIZE_E = 26
 
const PAPERSIZE_EXECUTIVE = 7
 
const PAPERSIZE_FOLIO = 14
 
const PAPERSIZE_GERMAN_LEGAL_FANFOLD = 41
 
const PAPERSIZE_GERMAN_STANDARD_FANFOLD = 40
 
const PAPERSIZE_INVITE_ENVELOPE = 47
 
const PAPERSIZE_ISO_B4 = 42
 
const PAPERSIZE_ISO_B5_EXTRA_PAPER = 63
 
const PAPERSIZE_ITALY_ENVELOPE = 36
 
const PAPERSIZE_JAPANESE_DOUBLE_POSTCARD = 43
 
const PAPERSIZE_JIS_B5_TRANSVERSE_PAPER = 60
 
const PAPERSIZE_LEDGER = 4
 
const PAPERSIZE_LEGAL = 5
 
const PAPERSIZE_LEGAL_EXTRA_PAPER = 49
 
const PAPERSIZE_LETTER = 1
 
const PAPERSIZE_LETTER_EXTRA_PAPER = 48
 
const PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER = 54
 
const PAPERSIZE_LETTER_PLUS_PAPER = 57
 
const PAPERSIZE_LETTER_SMALL = 2
 
const PAPERSIZE_LETTER_TRANSVERSE_PAPER = 52
 
const PAPERSIZE_MONARCH_ENVELOPE = 37
 
const PAPERSIZE_NO10_ENVELOPE = 20
 
const PAPERSIZE_NO11_ENVELOPE = 21
 
const PAPERSIZE_NO12_ENVELOPE = 22
 
const PAPERSIZE_NO14_ENVELOPE = 23
 
const PAPERSIZE_NO9_ENVELOPE = 19
 
const PAPERSIZE_NOTE = 18
 
const PAPERSIZE_QUARTO = 15
 
const PAPERSIZE_STANDARD_1 = 16
 
const PAPERSIZE_STANDARD_2 = 17
 
const PAPERSIZE_STANDARD_PAPER_1 = 44
 
const PAPERSIZE_STANDARD_PAPER_2 = 45
 
const PAPERSIZE_STANDARD_PAPER_3 = 46
 
const PAPERSIZE_STATEMENT = 6
 
const PAPERSIZE_SUPERA_SUPERA_A4_PAPER = 55
 
const PAPERSIZE_SUPERB_SUPERB_A3_PAPER = 56
 
const PAPERSIZE_TABLOID = 3
 
const PAPERSIZE_TABLOID_EXTRA_PAPER = 50
 
const PAPERSIZE_US_STANDARD_FANFOLD = 39
 
const SETPRINTRANGE_INSERT = 'I'
 
const SETPRINTRANGE_OVERWRITE = 'O'
 

Member Function Documentation

◆ addPrintArea()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::addPrintArea ( string $value,
int $index = -1 )

Add a new print area (e.g.

'A1:D10' or 'A1:D10,G5:M20') to the list of print areas.

Parameters
int$indexIdentifier for a specific print area range allowing several ranges to be set A positive index will insert after that indexed entry in the print areas list, while a negative index will insert before the indexed entry. Specifying an index value of 0, will always append the new print range at the end of the list. Print areas are numbered from 1
Return values
$this

◆ addPrintAreaByColumnAndRow()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::addPrintAreaByColumnAndRow ( int $column1,
int $row1,
int $column2,
int $row2,
int $index = -1 )

Add a new print area to the list of print areas.

Parameters
int$column1Start Column for the print area
int$row1Start Row for the print area
int$column2End Column for the print area
int$row2End Row for the print area
int$indexIdentifier for a specific print area range allowing several ranges to be set A positive index will insert after that indexed entry in the print areas list, while a negative index will insert before the indexed entry. Specifying an index value of 0, will always append the new print range at the end of the list. Print areas are numbered from 1
Return values
$this

◆ clearPrintArea()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::clearPrintArea ( int $index = 0)

Clear a print area.

Parameters
int$indexIdentifier for a specific print area range if several ranges have been set Default behaviour, or an index value of 0, will clear all print ranges that are set Otherwise, the range identified by the value of $index will be removed from the series Print areas are numbered from 1
Return values
$this

◆ getColumnsToRepeatAtLeft()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::getColumnsToRepeatAtLeft ( )

Get Columns to repeat at left.

Return values
arrayContaining start column and end column, empty array if option unset

◆ getPrintArea()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::getPrintArea ( int $index = 0)

Get print area.

Parameters
int$indexIdentifier for a specific print area range if several ranges have been set Default behaviour, or a index value of 0, will return all ranges as a comma-separated string Otherwise, the specific range identified by the value of $index will be returned Print areas are numbered from 1

◆ getRowsToRepeatAtTop()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::getRowsToRepeatAtTop ( )

Get Rows to repeat at top.

Return values
arrayContaining start column and end column, empty array if option unset

◆ isPrintAreaSet()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::isPrintAreaSet ( int $index = 0)

Is print area set?

Parameters
int$indexIdentifier for a specific print area range if several ranges have been set Default behaviour, or an index value of 0, will identify whether any print range is set Otherwise, existence of the range identified by the value of $index will be returned Print areas are numbered from 1

◆ resetFirstPageNumber()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::resetFirstPageNumber ( )

Reset first page number.

Return values
$this

◆ setColumnsToRepeatAtLeft()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setColumnsToRepeatAtLeft ( array $columnsToRepeatAtLeft)

Set Columns to repeat at left.

Parameters
array$columnsToRepeatAtLeftContaining start column and end column, empty array if option unset
Return values
$this

◆ setColumnsToRepeatAtLeftByStartAndEnd()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setColumnsToRepeatAtLeftByStartAndEnd ( string $start,
string $end )

Set Columns to repeat at left by start and end.

Parameters
string$starteg: 'A'
string$endeg: 'B'
Return values
$this

◆ setFirstPageNumber()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setFirstPageNumber ( ?int $value)

Set first page number.

Return values
$this

◆ setFitToHeight()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setFitToHeight ( ?int $fitToHeight,
bool $update = true )

Set Fit To Height.

Parameters
bool$updateUpdate fitToPage so it applies rather than scaling
Return values
$this

◆ setFitToPage()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setFitToPage ( bool $fitToPage)

Set Fit To Page.

Return values
$this

◆ setFitToWidth()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setFitToWidth ( ?int $value,
bool $update = true )

Set Fit To Width.

Parameters
bool$updateUpdate fitToPage so it applies rather than scaling
Return values
$this

◆ setHorizontalCentered()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setHorizontalCentered ( bool $value)

Set center page horizontally.

Return values
$this

◆ setOrientation()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setOrientation ( string $orientation)

Set Orientation.

Parameters
string$orientationsee self::ORIENTATION_*
Return values
$this

◆ setPaperSize()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setPaperSize ( int $paperSize)

Set Paper Size.

Parameters
int$paperSizesee self::PAPERSIZE_*
Return values
$this

◆ setPrintArea()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setPrintArea ( string $value,
int $index = 0,
string $method = self::SETPRINTRANGE_OVERWRITE )

Set print area.

e.g. 'A1:D10' or 'A1:D10,G5:M20'.

Parameters
int$indexIdentifier for a specific print area range allowing several ranges to be set When the method is "O"verwrite, then a positive integer index will overwrite that indexed entry in the print areas list; a negative index value will identify which entry to overwrite working bacward through the print area to the list, with the last entry as -1. Specifying an index value of 0, will overwrite all existing print ranges. When the method is "I"nsert, then a positive index will insert after that indexed entry in the print areas list, while a negative index will insert before the indexed entry. Specifying an index value of 0, will always append the new print range at the end of the list. Print areas are numbered from 1
string$methodDetermines the method used when setting multiple print areas Default behaviour, or the "O" method, overwrites existing print area The "I" method, inserts the new print area before any specified index, or at the end of the list
Return values
$this

◆ setPrintAreaByColumnAndRow()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setPrintAreaByColumnAndRow ( int $column1,
int $row1,
int $column2,
int $row2,
int $index = 0,
string $method = self::SETPRINTRANGE_OVERWRITE )

Set print area.

Parameters
int$column1Column 1
int$row1Row 1
int$column2Column 2
int$row2Row 2
int$indexIdentifier for a specific print area range allowing several ranges to be set When the method is "O"verwrite, then a positive integer index will overwrite that indexed entry in the print areas list; a negative index value will identify which entry to overwrite working backward through the print area to the list, with the last entry as -1. Specifying an index value of 0, will overwrite all existing print ranges. When the method is "I"nsert, then a positive index will insert after that indexed entry in the print areas list, while a negative index will insert before the indexed entry. Specifying an index value of 0, will always append the new print range at the end of the list. Print areas are numbered from 1
string$methodDetermines the method used when setting multiple print areas Default behaviour, or the "O" method, overwrites existing print area The "I" method, inserts the new print area before any specified index, or at the end of the list
Return values
$this

◆ setRowsToRepeatAtTop()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setRowsToRepeatAtTop ( array $rowsToRepeatAtTop)

Set Rows to repeat at top.

Parameters
array$rowsToRepeatAtTopContaining start column and end column, empty array if option unset
Return values
$this

◆ setRowsToRepeatAtTopByStartAndEnd()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setRowsToRepeatAtTopByStartAndEnd ( int $start,
int $end )

Set Rows to repeat at top by start and end.

Parameters
int$starteg: 1
int$endeg: 1
Return values
$this

◆ setScale()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setScale ( ?int $scale,
bool $update = true )

Set Scale.

Print scaling. Valid values range from 10 to 400 This setting is overridden when fitToWidth and/or fitToHeight are in use.

Parameters
bool$updateUpdate fitToPage so scaling applies rather than fitToHeight / fitToWidth
Return values
$this

◆ setVerticalCentered()

PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::setVerticalCentered ( bool $value)

Set center page vertically.

Return values
$this

The documentation for this class was generated from the following file: