Page of a Notebook

Page of a Notebook

The Page class stores everything that is drawn on the page as well as format data of the page (like aspect ratio).

class quill.page.Page(number, uuid, aspect_ratio, strokes, lines, images)[source]

Bases: object

Page of a notebook

EXAMPLES:

>>> type(sample_page)
<class 'quill.page.Page'>
>>> print sample_page
page number 0
aspect_ratio()[source]

Return the aspect ratio.

Return type:float, the ratio of width divided by height.

EXAMPLES:

>>> sample_page.aspect_ratio()
0.7071067690849304
book()[source]

Return the notebook containing the page.

Return type:a Book

EXAMPLES:

>>> sample_page.book()    
Book title: Example Notebook
Uuid: 1fd6a485-33ed-4a45-a5a1-e06e55fdca57
Created ...
Last modified ...
images()[source]

Return the images

Return type:a tuple of Image objects

EXAMPLES:

>>> sample_page.images()
(image at (0.13,0.605):(0.455,0.739),)
lines()

Return the straight lines

Return type:a tuple of Line objects

EXAMPLES:

>>> len(sample_page.lines())
2
>>> sample_page.lines()[0]
line from (0.175,0.532) to (0.629,0.442)
number()[source]

Return the page number.

Return type:integer

EXAMPLES:

>>> sample_page.number()
0
strokes()[source]

Return the strokes

Return type:a tuple of Stroke objects

EXAMPLES:

>>> len(sample_page.strokes())
125
>>> sample_page.strokes()[0]
pen stroke with 40 points
uuid()[source]

Return the page uuid.

Return type:string

EXAMPLES:

>>> sample_page.uuid()
'9aa10c71-c872-4d2b-b97e-1845fd5a4cfc'

Previous topic

A Single Notebook

Next topic

Pen Stroke

This Page