diff options
author | Fabio D'Urso <fabiodurso@hotmail.it> | 2012-11-02 10:54:17 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2012-11-03 14:01:45 +0100 |
commit | 0f7c17d7f92d4cdfbd8816dba666aeed924d8bc2 (patch) | |
tree | 3278e95f47bce9c3659f6e579284aa811548bee0 /utils | |
parent | f3f5a166bcd16b6f2cb516cceb2b3f41b6faf0b4 (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 'utils')
-rw-r--r-- | utils/pdfinfo.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc index 799a35c5..bd8b56d1 100644 --- a/utils/pdfinfo.cc +++ b/utils/pdfinfo.cc @@ -229,16 +229,17 @@ int main(int argc, char *argv[]) { doc->getStructTreeRoot()->isDict() ? "yes" : "no"); // print form info - if ((acroForm = doc->getCatalog()->getAcroForm())->isDict()) { - acroForm->dictLookup("XFA", &xfa); - if (xfa.isStream() || xfa.isArray()) { - printf("Form: XFA\n"); - } else { + switch (doc->getCatalog()->getFormType()) + { + case Catalog::NoForm: + printf("Form: none\n"); + break; + case Catalog::AcroForm: printf("Form: AcroForm\n"); - } - xfa.free(); - } else { - printf("Form: none\n"); + break; + case Catalog::XfaForm: + printf("Form: XFA\n"); + break; } // print page count |