Poppler.Attachment

g GObject.Object GObject.Object Poppler.Attachment Poppler.Attachment GObject.Object->Poppler.Attachment

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_checksum ()

get_ctime ()

get_description ()

get_mtime ()

get_name ()

get_size ()

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)

Name

Type

Access

Description

checksum

GLib.String

r

A 16-byte checksum of the file. Deprecated in poppler 20.09.0. Use Poppler.Attachment.get_checksum() instead.

ctime

int

r

The date and time when the file was created. Deprecated in poppler 20.09.0. Use Poppler.Attachment.get_ctime() instead.

description

str

r

Descriptive text. Deprecated in poppler 20.09.0. Use Poppler.Attachment.get_description() instead.

mtime

int

r

The date and time when the file was last modified. Deprecated in poppler 20.09.0. Use Poppler.Attachment.get_mtime() instead.

name

str

r

The filename. Deprecated in poppler 20.09.0. Use Poppler.Attachment.get_name() instead.

parent

GObject.Object

r

size

int

r

The size of the file. Deprecated in poppler 20.09.0. Use Poppler.Attachment.get_size() instead.

Class Details

class Poppler.Attachment(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Poppler.AttachmentClass

get_checksum()
Returns:

The attachment’s checksum.

Return type:

GLib.String

New in version 20.09.0.

get_ctime()
Returns:

The attachment’s creation date and time as a GLib.DateTime, or None if the creation date and time is not available.

Return type:

GLib.DateTime or None

New in version 20.09.0.

get_description()
Returns:

The attachment’s descriptive text.

Return type:

str

New in version 20.09.0.

get_mtime()
Returns:

The attachment’s modification date and time as a GLib.DateTime, or None if the modification date and time is not available.

Return type:

GLib.DateTime or None

New in version 20.09.0.

get_name()
Returns:

The attachment’s name.

Return type:

str

New in version 20.09.0.

get_size()
Returns:

The attachment’s size.

Return type:

int

New in version 20.09.0.

save(filename)
Parameters:

filename (str) – name of file to save

Raises:

GLib.Error

Returns:

True, if the file successfully saved

Return type:

bool

Saves 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.

save_to_callback(save_func, *user_data)
Parameters:
  • save_func (Poppler.AttachmentSaveFunc) – 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 self by feeding the produced data to save_func. Can be used when you want to store the attachment 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.

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 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.