Pages of a document.
Use Document.pages to obtain instances of this class.
Page indexing is zero-based, i.e. pages[0] stands for the very first page.
len(pages) might return 1 when called before receiving a DocInfoMessage.
Page of a document.
Use Document.pages[N] to obtain instances of this class.
Returns: | the page number. |
---|
Page indexing is zero-based, i.e. 0 stands for the very first page.
Attempt to obtain information about the page without decoding the page.
If wait is true, wait until the information is available.
If the information is not available, raise NotAvailable exception. Then, start fetching the page data, which causes emission of PageInfoMessage messages with empty page_job.
Raises NotAvailable: | |
---|---|
see above. | |
Raises JobFailed: | |
on failure. |
Returns: | the page width, in pixels. |
---|---|
Raises NotAvailable: | |
see get_info(). | |
Raises JobFailed: | |
on failure. |
Returns: | the page height, in pixels. |
---|---|
Raises NotAvailable: | |
see get_info(). | |
Raises JobFailed: | |
on failure. |
Returns: | (page.width, page.height) |
---|---|
Raises NotAvailable: | |
see get_info(). | |
Raises JobFailed: | |
on failure. |
Returns: | the page resolution, in pixels per inch. |
---|---|
Raises NotAvailable: | |
see get_info(). | |
Raises JobFailed: | |
on failure. |
Returns: | the initial page rotation, in degrees. |
---|---|
Raises NotAvailable: | |
see get_info(). | |
Raises JobFailed: | |
on failure. |
Returns: | the page version. |
---|---|
Raises NotAvailable: | |
see get_info(). | |
Raises JobFailed: | |
on failure. |
Returns: | a text describing the contents of the page using the same format as the djvudump command. |
---|
If the information is not available, raise NotAvailable exception. Then PageInfoMessage messages with empty page_job may be emitted.
Raises NotAvailable: | |
---|---|
see above. |
Initiate data transfer and decoding threads for the page.
If wait is true, wait until the job is done.
Return type: | PageJob. |
---|---|
Raises NotAvailable: | |
if called before receiving the DocInfoMessage. | |
Raises JobFailed: | |
if document decoding failed. |
Return type: | PageAnnotations |
---|
Inheritance diagram:
A page decoding job.
Use Page.decode() to obtain instances of this class.
Returns: | the page width in pixels. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the page height in pixels. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | (page_job.width, page_job.height) |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the page resolution in pixels per inch. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the gamma of the display for which this page was designed. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the version of the DjVu file format. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the type of the page data. |
---|
Possible values are:
Raises NotAvailable: | |
---|---|
before receiving a PageInfoMessage. |
Returns: | the counter-clockwise page rotation angle (in degrees) specified by the orientation flags in the DjVu file. |
---|
Warning
This is useful because maparea coordinates in the annotation chunks are expressed relative to the rotated coordinates whereas text coordinates in the hidden text data are expressed relative to the unrotated coordinates.
Returns: | the counter-clockwise rotation angle (in degrees) for the page. |
---|
The rotation is automatically taken into account by render() method and width and height properties.
Render a segment of a page with arbitrary scale. mode indicates what image layers should be rendered:
Conceptually this method renders the full page into a rectangle page_rect and copies the pixels specified by rectangle render_rect into a buffer. The actual code is much more efficient than that.
pixel_format specifies the expected pixel format. Each row will start at row_alignment bytes boundary.
This method makes a best effort to compute an image that reflects the most recently decoded data.
Raises NotAvailable: | |
---|---|
to indicate that no image could be computed at this point. |
Thumbnail for a page.
Use Page.thumbnail to obtain instances of this class.
Returns: | the page. |
---|
Determine whether the thumbnail is available.
Returns: | a JobException subclass indicating the current job status. |
---|
Determine whether the thumbnail is available. If it’s not, initiate the thumbnail calculating job. Regardless of its success, the completion of the job is signalled by a subsequent ThumbnailMessage.
Return a JobException subclass indicating the current job status.
Render the thumbnail:
Returns: | a ((w1, h1, row_size), data) tuple. |
---|
Raises NotAvailable: | |
---|---|
when no thumbnail is available. |