__init__ constructor

init

Initializes a new instance of Converter.

def __init__(self, source_stream_provider):
    ...
Parameter Type Description
source_stream_provider Func[io.RawIOBase] The method that returns a readable stream.
Raises Description
ValueError Raised when source_stream_provider is None.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with open("input.docx", "rb") as stream:
    with Converter(stream) as converter:
        converter.convert("output.pdf", PdfConvertOptions())

init

Initializes a new Converter instance.

Learn more

def __init__(self, source_stream_provider, settings):
    ...
Parameter Type Description
source_stream_provider Func[io.RawIOBase] The method that returns a readable stream.
settings Func[ConverterSettings] The Converter settings.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with Converter("input.docx") as converter:
    converter.convert("output.pdf", PdfConvertOptions())

init

Initializes a new Converter instance.

def __init__(self, source_stream_provider, load_options, settings):
    ...
Parameter Type Description
source_stream_provider Func[io.RawIOBase] Callable that returns a readable io.RawIOBase stream.
load_options Func[LoadContext, LoadOptions] Callable[[LoadContext], GroupDocs.Conversion.LoadOptions] that provides load options for the document. The LoadContext parameter contains information about the document being loaded.
settings Func[ConverterSettings] ConverterSettings specifying the converter settings.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with open("input.docx", "rb") as stream:
    with Converter(stream) as converter:
        converter.convert("output.pdf", PdfConvertOptions())

init

Initializes a new Converter with explicit conversion events.

def __init__(self, source_stream_provider, load_options, settings, events):
    ...
Parameter Type Description
source_stream_provider Func[io.RawIOBase] Callable that returns a readable stream.
load_options Func[LoadContext, LoadOptions] Callable that provides load options for the document.
settings Func[ConverterSettings] Converter settings.
events Func[ConversionEvents] Callable that provides aggregated ConversionEvents registered for the converter’s lifetime.

init

Initializes a new Converter instance with explicit conversion events.

def __init__(self, source_stream_provider, settings, events):
    ...
Parameter Type Description
source_stream_provider Func[io.RawIOBase] Callable that returns a readable stream.
settings Func[ConverterSettings] Converter settings.
events Func[ConversionEvents] Delegate providing aggregated ConversionEvents registered for the converter’s lifetime.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with open("input.docx", "rb") as stream:
    with Converter(stream) as converter:
        converter.convert("output.pdf", PdfConvertOptions())

init

Initializes a new Converter instance.

def __init__(self, file_path):
    ...
Parameter Type Description
file_path str The file path to the source document.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with Converter("input.docx") as converter:
    converter.convert("output.pdf", PdfConvertOptions())

init

Initializes a new Converter instance.

Learn more

def __init__(self, file_path, settings):
    ...
Parameter Type Description
file_path str The file path to the source document.
settings Func[ConverterSettings] The Converter settings.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with Converter("input.docx") as converter:
    converter.convert("output.pdf", PdfConvertOptions())

init

Initializes new instance of Converter class.

Learn more

def __init__(self, file_path, load_options, settings):
    ...
Parameter Type Description
file_path str The file path to the source document.
load_options Func[LoadContext, LoadOptions] Delegate that provides load options for the document. Signature: Func<LoadContext, LoadOptions>. The LoadContext parameter contains information about the document being loaded.
settings Func[ConverterSettings] The Converter settings.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with Converter("input.docx") as converter:
    converter.convert("output.pdf", PdfConvertOptions())

init

Initializes a new Converter with explicit conversion events.

def __init__(self, file_path, load_options, settings, events):
    ...
Parameter Type Description
file_path str The file path to the source document.
load_options Func[LoadContext, LoadOptions] Delegate that provides load options for the document.
settings Func[ConverterSettings] The Converter settings.
events Func[ConversionEvents] Delegate that provides aggregated ConversionEvents registered for the converter’s lifetime.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with Converter("input.docx") as converter:
    converter.convert("output.pdf", PdfConvertOptions())

init

Initializes a new Converter with explicit conversion events.

def __init__(self, file_path, settings, events):
    ...
Parameter Type Description
file_path str The file path to the source document.
settings Func[ConverterSettings] The Converter settings.
events Func[ConversionEvents] Delegate that provides aggregated ConversionEvents registered for the converter’s lifetime.

Example

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with Converter("input.docx") as converter:
    converter.convert("output.pdf", PdfConvertOptions())

See Also