printer.getPageSize

From ComputerCraft Wiki
Jump to: navigation, search


Grid Redstone.png  Function printer.getPageSize
Returns the size of the paper, works the same way as term.getSize().
Syntax printer.getPageSize()
Returns number width of the page, number height of the page
Part of ComputerCraft
API printer

Examples

Grid paper.png  Example
Prints the size of a page.
Code
local printer = peripheral.wrap("left")

printer.newPage()

local width, height = printer.getPageSize()

print("The size of the page is " .. width .. "x" .. height)
printer.write("Width: " .. width .. " Height: height")

printer.endPage()
Output The size of the page is 25x21