Class ExportJpgPartial

class ooodev.draw.shapes.partial.export_jpg_partial.ExportJpgPartial(component, events=None, lo_inst=None)[source]

Partial Class for Shapes that implements jpg export.

Parameters:
  • component (XShape) –

  • events (Events | None) –

  • lo_inst (LoInst | None) –

__init__(component, events=None, lo_inst=None)[source]

Constructor.

Parameters:
  • component (XShape) – Shape component.

  • events (Events, optional) – Events instance.

  • lo_inst (LoInst, optional) – Lo Instance. Use when creating multiple documents. Defaults to None.

export_shape_jpg(fnm, resolution=96)[source]

Exports shape as jpg image.

Parameters:
  • fnm (PathOrStr, optional) – Image file name.

  • resolution (int, optional) – Resolution in dpi. Defaults to 96.

Events:
Return type:

None

Note

On exporting event is Class CancelEventArgsExport. On exported event is Class EventArgsExport. Args event_data is a ExportJpgT dictionary.

If fnm is not specified, the image file name is created based on the document name and page number and written to the same folder as the document.

subscribe_event_shape_jpg_exported(callback)[source]

Add an event listener to current instance that is triggered on export complete.

Parameters:

callback (Callable[[Any, EventArgsExport[ExportJpgT]], None]) – Callback of the event listener.

Return type:

None

subscribe_event_shape_jpg_exporting(callback)[source]

Add an event listener to current instance that is triggered on exporting.

Parameters:

callback (Callable[[Any, CancelEventArgsExport[ExportJpgT]], None]) – Callback of the event listener.

Return type:

None

unsubscribe_event_shape_jpg_exported(callback)[source]

Remove an event listener from current instance.

Parameters:

callback (Callable[[Any, EventArgsExport[ExportJpgT]], None]) – Callback of the event listener.

Return type:

None

unsubscribe_event_shape_jpg_exporting(callback)[source]

Remove an event listener from current instance.

Parameters:

callback (Callable[[Any, CancelEventArgsExport[ExportJpgT]], None]) – Callback of the event listener.

Return type:

None