__init__ constructor

init

Initializes a new PngViewOptions instance.

For the code example, see the documentation.

def __init__(self, create_page_stream):
    ...
Parameter Type Description
create_page_stream CreatePageStream The method that instantiates a stream used to write output page data.
Raises Description
ValueError When create_page_stream is None.

init

Initializes an instance of the PngViewOptions class.

For the code example, see the documentation.

def __init__(self, create_page_stream, release_page_stream):
    ...
Parameter Type Description
create_page_stream CreatePageStream The method that instantiates a stream used to write output page data.
release_page_stream ReleasePageStream The method that releases a stream created by the method assigned to the delegate passed to create_page_stream parameter.
Raises Description
ValueError When release_page_stream is None.

init

Initializes a new PngViewOptions instance.

For more information, see the documentation.

def __init__(self, page_stream_factory):
    ...
Parameter Type Description
page_stream_factory IPageStreamFactory The factory which implements methods for creating and releasing output page stream.
Raises Description
ValueError If page_stream_factory is None.

init

Initializes a PngViewOptions instance.

This constructor creates a PngViewOptions with "p_{0}.png" as the default file path format for the output files. The generated PNG files are saved in the current working directory of the application.

def __init__(self):
    ...

Example

from groupdocs.viewer import Viewer
from groupdocs.viewer.options import PngViewOptions

with Viewer("document.pdf") as viewer:
    viewer.view(PngViewOptions("page_{0}.png"))

init

Initializes a new PngViewOptions instance.

For the code example, see the documentation.

def __init__(self, file_path_format):
    ...
Parameter Type Description
file_path_format str The file path format, e.g. 'page_{0}.png'.
Raises Description
ValueError When file_path_format is None or empty.

Example

from groupdocs.viewer import Viewer
from groupdocs.viewer.options import PngViewOptions

with Viewer("document.pdf") as viewer:
    viewer.view(PngViewOptions("page_{0}.png"))

See Also