previousWorksheet::setLandscape (Previous) (Next) Worksheet::setHeadernext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Worksheet::setPaper

Worksheet::setPaper – Set the paper type. Ex. 1 = US Letter, 9 = A4

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Worksheet::setPaper ( integer $size=0 )

Description

Set the paper type. Ex. 1 = US Letter, 9 = A4

Parameter

  • integer $size - The type of paper size to use

Note

This function can not be called statically.

Example

Using setPaper()

<?php

require_once 'Spreadsheet/Excel/Writer.php';

// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();

// sending HTTP headers
$workbook->send('test.xls');

// Creating a worksheet
$worksheet =& $workbook->addWorksheet('My first worksheet');

//set paper size
$worksheet->setPaper(9);

// The actual data
$worksheet->write(00'Name');
$worksheet->write(01'Age');
$worksheet->write(10'John Smith');
$worksheet->write(1130);
$worksheet->write(20'Johann Schmidt');
$worksheet->write(2131);
$worksheet->write(30'Juan Herrera');
$worksheet->write(3132);

// Let's send the file
$workbook->close();
?>
previousWorksheet::setLandscape (Previous) (Next) Worksheet::setHeadernext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: kcubabukoh@readysetservice.com
Number Paper Size
1 USLetter
2 A4
3 B11 X 17
4 A4
5 LGL8.5 X 14
6 HLT5.5 X 8.5
7 EXE7.5 X 10.5
8 A3
9 A4

These are the ones I know. I am not sure if there are more paper sizes.
Note by: daniel.kauffman@rocksolidsolutions.org
For a list of additional paper sizes, see:

http://rocksolidsolutions.org/reference/excel_file_format_paper_size_table.html

For example, 5 = US Legal, 8 = A3

Thanks to the crew at http://sc.openoffice.org for making the Excel file format documentation available.