summaryrefslogtreecommitdiff
path: root/qt4/tests/check_orientation.cpp
blob: 36b33dc01eed5648cbd37c278ca6b60a86904e7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdlib.h>
#include <QtCore/QtCore>
#include <QtGui/QtGui>
#include <ctype.h>

#define UNSTABLE_POPPLER_QT4
#include <poppler-qt4.h>

int main( int argc, char **argv )
{
    QApplication a( argc, argv );               // QApplication required!

    Poppler::Document *doc = Poppler::Document::load("../../../test/unittestcases/orientation.pdf");
    if (!doc)
    {
	exit(1);
    }
  
    Poppler::Page *page = doc->page(0);
    if ( !( page->orientation() == Poppler::Page::Portrait ) ) {
	exit(2);
    }

    page = doc->page(1);
    if ( !( page->orientation() == Poppler::Page::Landscape ) ) {
	exit(3);
    }

    page = doc->page(2);
    if ( !( page->orientation() == Poppler::Page::UpsideDown) ) {
	exit(4);
    }

    page = doc->page(3);
    if ( !( page->orientation() == Poppler::Page::Seascape ) ) {
	exit(5);
    }

    exit(0);
}