poppler.utilities module

This module contains utility functions that are not part of poppler-cpp, but that helps interacting with it.

poppler.utilities.from_time_type(timestamp)

Convert a timestamp to a datetime.datetime object.

Parameters:

timestamp (int) – a positive integer, to be interpreted as 32 bits complement 2.

Returns:

the date and time,

or None if the timestamp is equivalent to -1.

Return type:

Optional[datetime.datetime]

poppler.utilities.since(major, minor)

Decorator used to mark the minimum required version of poppler needed to execute a function.

If poppler version is lower than the specified version, it raises a NotImplementedError when called.

Parameters:
  • major (int) – major version number

  • minor (int) – minor version number

poppler.utilities.to_time_type(date_time)

Convert a Python datetime.datetime object to a timestamp compatible with poppler.

Parameters:

date_time (Optional[datetime.datetime]) – the date and time, or None

Returns:

the timestamp

Return type:

int

poppler.utilities.version()

Get poppler version, as a tuple

Returns:

(major, minor, micro)

Return type:

Tuple[int, int, int]