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();
?>