Skip to content

Make getPdfVersion return a pair of numbers (major, minor)

Oliver Sander requested to merge sander/poppler:modernize-pdf-version into master

That's a bit more modern than the old way where pointers to two integers had to be passed to the method.

With the new method you can write

int major, minor;
std::tie(major, minor) = doc->getPdfVersion();

instead of

int major, minor;
doc->getPdfVersion(&major, &minor);

which, admittedly, is only moderately impressive.

It gets better though with C++17, where you can simply write

auto [major, minor] = doc->getPdfVersion();

The new method is put alongside the old one in the Qt5 interface. It replaces the old one in the Qt6 interface.

Edited by Oliver Sander

Merge request reports