Commit 14dfe5c7 authored by Volker Krause's avatar Volker Krause
Browse files

Add accessor for the PDF document producer

parent 40cfd1ff
......@@ -22,6 +22,7 @@
"text": " Akademy Airways\n Boarding Pass\nFrom: Vienna International, Terminal 2\nTo: Milano Malpensa, Terminal 1\nFlight: AK 1996\nGate: A36\nBoarding Time: 15:20\nDeparture Time: 15:45\nArrival Time: 17:20\nPassenger: Dragon, Dr. Konqi\n"
}
],
"producer": "cairo 1.16.0 (https://cairographics.org)",
"text": " Akademy Airways\n Boarding Pass\nFrom: Vienna International, Terminal 2\nTo: Milano Malpensa, Terminal 1\nFlight: AK 1996\nGate: A36\nBoarding Time: 15:20\nDeparture Time: 15:45\nArrival Time: 17:20\nPassenger: Dragon, Dr. Konqi\n"
}
},
......@@ -83,6 +84,7 @@
"text": " Akademy Airways\n Boarding Pass\nFrom: Vienna International, Terminal 2\nTo: Milano Malpensa, Terminal 1\nFlight: AK 1996\nGate: A36\nBoarding Time: 15:20\nDeparture Time: 15:45\nArrival Time: 17:20\nPassenger: Dragon, Dr. Konqi\n"
}
],
"producer": "cairo 1.16.0 (https://cairographics.org)",
"text": " Akademy Airways\n Boarding Pass\nFrom: Vienna International, Terminal 2\nTo: Milano Malpensa, Terminal 1\nFlight: AK 1996\nGate: A36\nBoarding Time: 15:20\nDeparture Time: 15:45\nArrival Time: 17:20\nPassenger: Dragon, Dr. Konqi\n"
},
"contextDateTime": "Mon Aug 19 20:23:28 2019 GMT+0200",
......
......@@ -296,6 +296,15 @@ QDateTime PdfDocument::modificationTime() const
#endif
}
QString PdfDocument::producer() const
{
std::unique_ptr<GooString> s(d->m_popplerDoc->getDocInfoProducer());
if (!s) {
return {};
}
return QString::fromUtf8(s->c_str());
}
QVariantList PdfDocument::pagesVariant() const
{
QVariantList l;
......
......@@ -92,6 +92,7 @@ class KITINERARY_EXPORT PdfDocument : public QObject
Q_PROPERTY(QVariantList pages READ pagesVariant CONSTANT)
Q_PROPERTY(QDateTime creationTime READ creationTime CONSTANT)
Q_PROPERTY(QDateTime modificationTime READ modificationTime CONSTANT)
Q_PROPERTY(QString producer READ producer CONSTANT)
public:
explicit PdfDocument(QObject *parent = nullptr);
......@@ -114,6 +115,9 @@ public:
/** Modification time as specified in the PDF file. */
QDateTime modificationTime() const;
/** The document producer. */
QString producer() const;
/** Creates a PdfDocument from the given raw data.
* @returns @c nullptr if loading fails or Poppler was not found.
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment