Poppler.Media

g GObject.Object GObject.Object Poppler.Media Poppler.Media GObject.Object->Poppler.Media

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_auto_play ()

get_filename ()

get_mime_type ()

get_repeat_count ()

get_show_controls ()

is_embedded ()

save (filename)

save_to_callback (save_func, *user_data)

save_to_fd (fd)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Poppler.Media(**kwargs)
Bases:

GObject.Object

Abstract:

No

get_auto_play()
Returns:

True if media should auto-play, False otherwise

Return type:

bool

Returns the auto-play parameter.

New in version 20.04.0.

get_filename()
Returns:

a filename, return value is owned by Poppler.Media and should not be freed

Return type:

str

Returns the media clip filename, in case of non-embedded media. filename might be a local relative or absolute path or a URI

New in version 0.14.

get_mime_type()
Returns:

the mime-type, return value is owned by Poppler.Media and should not be freed

Return type:

str

Returns the media clip mime-type

New in version 0.14.

get_repeat_count()
Returns:

Repeat count parameter (float)

Return type:

float

Returns the repeat count parameter.

New in version 20.04.0.

get_show_controls()
Returns:

True if media should show controls, False otherwise

Return type:

bool

Returns the show controls parameter.

New in version 20.04.0.

is_embedded()
Returns:

True if media clip is embedded, False otherwise

Return type:

bool

Whether the media clip is embedded in the PDF. If the result is True, the embedded stream can be saved with Poppler.Media.save() or Poppler.Media.save_to_callback() function. If the result is False, the media clip filename can be retrieved with Poppler.Media.get_filename() function.

New in version 0.14.

save(filename)
Parameters:

filename (str) – name of file to save

Raises:

GLib.Error

Returns:

True, if the file successfully saved

Return type:

bool

Saves embedded stream of self to a file indicated by filename. If error is set, False will be returned. Possible errors include those in the #G_FILE_ERROR domain and whatever the save function generates.

New in version 0.14.

save_to_callback(save_func, *user_data)
Parameters:
  • save_func (Poppler.MediaSaveFunc) – a function that is called to save each block of data that the save routine generates.

  • user_data (object or None) – user data to pass to the save function.

Raises:

GLib.Error

Returns:

True, if the save successfully completed

Return type:

bool

Saves embedded stream of self by feeding the produced data to save_func. Can be used when you want to store the media clip stream to something other than a file, such as an in-memory buffer or a socket. If error is set, False will be returned. Possible errors include those in the #G_FILE_ERROR domain and whatever the save function generates.

New in version 0.14.

save_to_fd(fd)
Parameters:

fd (int) – a valid file descriptor open for writing

Raises:

GLib.Error

Returns:

True, if the file successfully saved

Return type:

bool

Saves embedded stream of self to a file referred to by fd. If error is set, False will be returned. Possible errors include those in the #G_FILE_ERROR domain and whatever the save function generates. Note that this function takes ownership of fd; you must not operate on it again, nor close it.

New in version 21.12.0.