summaryrefslogtreecommitdiff
path: root/qt4/src
diff options
context:
space:
mode:
authorFabio D'Urso <fabiodurso@hotmail.it>2012-11-02 10:54:17 +0100
committerAlbert Astals Cid <aacid@kde.org>2012-11-03 14:01:45 +0100
commit0f7c17d7f92d4cdfbd8816dba666aeed924d8bc2 (patch)
tree3278e95f47bce9c3659f6e579284aa811548bee0 /qt4/src
parentf3f5a166bcd16b6f2cb516cceb2b3f41b6faf0b4 (diff)
qt4: Export information about the document form type
This patch also wraps the code that checks the form type and moves it from pdfinfo to the Catalog class.
Diffstat (limited to 'qt4/src')
-rw-r--r--qt4/src/poppler-document.cc16
-rw-r--r--qt4/src/poppler-qt4.h18
2 files changed, 34 insertions, 0 deletions
diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc
index 0cf1d451..ee56ed69 100644
--- a/qt4/src/poppler-document.cc
+++ b/qt4/src/poppler-document.cc
@@ -6,6 +6,7 @@
* Copyright (C) 2010, 2011 Hib Eris <hib@hiberis.nl>
* Copyright (C) 2012 Koji Otani <sho@bbr.jp>
* Copyright (C) 2012 Thomas Freitag <Thomas.Freitag@alfa.de>
+ * Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -612,6 +613,21 @@ namespace Poppler {
return true;
}
+ Document::FormType Document::formType() const
+ {
+ switch ( m_doc->doc->getCatalog()->getFormType() )
+ {
+ case Catalog::NoForm:
+ return Document::NoForm;
+ case Catalog::AcroForm:
+ return Document::AcroForm;
+ case Catalog::XfaForm:
+ return Document::XfaForm;
+ }
+
+ return Document::NoForm; // make gcc happy
+ }
+
QDateTime convertDate( char *dateString )
{
int year, mon, day, hour, min, sec, tzHours, tzMins;
diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h
index 3002e655..f4f6fc65 100644
--- a/qt4/src/poppler-qt4.h
+++ b/qt4/src/poppler-qt4.h
@@ -853,6 +853,17 @@ delete it;
Q_DECLARE_FLAGS( RenderHints, RenderHint )
/**
+ Form types
+
+ \since 0.22
+ */
+ enum FormType {
+ NoForm, ///< Document doesn't contain forms
+ AcroForm, ///< AcroForm
+ XfaForm ///< Adobe XML Forms Architecture (XFA), currently unsupported
+ };
+
+ /**
Set a color display profile for the current document.
\param outputProfileA is a \c cmsHPROFILE of the LCMS library.
@@ -1364,6 +1375,13 @@ QString subject = m_doc->info("Subject");
bool getPdfId(QByteArray *permanentId, QByteArray *updateId) const;
/**
+ Returns the type of forms contained in the document
+
+ \since 0.22
+ */
+ FormType formType() const;
+
+ /**
Destructor.
*/
~Document();