__init__ constructor
Leave feedback
On this page
Initializes a new instance of Converter.
- More about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third‑party storage: https://docs.groupdocs.com/display/conversionnet/Loading+documents+from+different+sources
- More about document loading options dependent on file type: https://docs.groupdocs.com/display/conversionnet/Load+options+for+different+document+types
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. |
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())
Initializes a new Converter instance.
Learn more
- More about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third‑party storage: https://docs.groupdocs.com/display/conversionnet/Loading+documents+from+different+sources
- More about document loading options dependent on file type: https://docs.groupdocs.com/display/conversionnet/Load+options+for+different+document+types
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. |
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
with Converter("input.docx") as converter:
converter.convert("output.pdf", PdfConvertOptions())
Initializes a new Converter instance.
- More about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third‑party storage: https://docs.groupdocs.com/display/conversionnet/Loading+documents+from+different+sources
- More about document loading options dependent on file type: https://docs.groupdocs.com/display/conversionnet/Load+options+for+different+document+types
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. |
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())
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. |
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. |
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())
Initializes a new Converter instance.
- More about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third‑party storage: https://docs.groupdocs.com/display/conversionnet/Loading+documents+from+different+sources
- More about document loading options dependent on file type: https://docs.groupdocs.com/display/conversionnet/Load+options+for+different+document+types
def __init__(self, file_path):
...
| Parameter | Type | Description |
|---|---|---|
| file_path | str |
The file path to the source document. |
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
with Converter("input.docx") as converter:
converter.convert("output.pdf", PdfConvertOptions())
Initializes a new Converter instance.
Learn more
- More about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third‑party storage: https://docs.groupdocs.com/display/conversionnet/Loading+documents+from+different+sources
- More about document loading options dependent on file type: https://docs.groupdocs.com/display/conversionnet/Load+options+for+different+document+types
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. |
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
with Converter("input.docx") as converter:
converter.convert("output.pdf", PdfConvertOptions())
Initializes new instance of Converter class.
Learn more
- More about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third‑party storage: https://docs.groupdocs.com/display/conversionnet/Loading+documents+from+different+sources
- More about document loading options dependent on file type: https://docs.groupdocs.com/display/conversionnet/Load+options+for+different+document+types
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. |
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
with Converter("input.docx") as converter:
converter.convert("output.pdf", PdfConvertOptions())
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. |
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
with Converter("input.docx") as converter:
converter.convert("output.pdf", PdfConvertOptions())
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. |
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
with Converter("input.docx") as converter:
converter.convert("output.pdf", PdfConvertOptions())
- class
Converter
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.