__init__ constructor
Leave feedback
On this page
Initializes a new instance of the PageImageArea class.
def __init__(self, image_stream, file_type, rotation):
...
| Parameter | Type | Description |
|---|---|---|
| image_stream | io.RawIOBase |
The stream of the image. |
| file_type | FileType |
The format of the image. |
| rotation | float |
The rotation angle of the image. |
Initializes a new PageImageArea instance.
def __init__(self, image_stream, file_type, rotation, page, rectangle):
...
| Parameter | Type | Description |
|---|---|---|
| image_stream | io.RawIOBase |
The stream of the image. |
| file_type | FileType |
The format of the image. |
| rotation | float |
The rotation angle of the image. |
| page | Page |
The page that contains the image. |
| rectangle | Rectangle |
The rectangular area that contains the image. |
from groupdocs.parser.data import PageImageArea, Page, Rectangle
from groupdocs.parser.options import FileType
# Assume `page_obj` is a `Page` instance obtained from a parsed document
with open("image.png", "rb") as stream:
area = PageImageArea(
image_stream=stream,
file_type=FileType.PNG,
rotation=0.0,
page=page_obj,
rectangle=Rectangle(0, 0, 100, 100)
)
# Save the extracted image to a file
area.save("output.png")
- class
PageImageArea
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.