mupdf-qt  0.1
Qt5 interface of the popular PDF library MuPDF
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Pages
mupdf-page.h
Go to the documentation of this file.
1 #ifndef MUPDF_PAGE_H
2 #define MUPDF_PAGE_H
3 
4 #include <QList>
5 
6 class QImage;
7 class QString;
8 class QPointF;
9 class QSizeF;
10 class QRectF;
11 
12 namespace MuPDF
13 {
14 class Page;
15 class PagePrivate;
16 class Document;
17 class TextBox;
18 
24 QPointF mapToOrigin(const QPointF &pos, float scaleX, float scaleY, float rotation = 0.0f);
30 QSizeF mapToOrigin(const QSizeF &size, float scaleX, float scaleY, float rotation = 0.0f);
36 QRectF mapToOrigin(const QRectF &rect, float scaleX, float scaleY, float rotation = 0.0f);
42 QPointF mapFromOrigin(const QPointF &pos, float scaleX, float scaleY, float rotation = 0.0f);
48 QSizeF mapFromOrigin(const QSizeF &size, float scaleX, float scaleY, float rotation = 0.0f);
54 QRectF mapFromOrigin(const QRectF &rect, float scaleX, float scaleY, float rotation = 0.0f);
55 
62 class Page
63 {
64 public:
65  ~Page();
66  bool isValid() const;
67  QImage renderImage(float scaleX = 1.0f, float scaleY = 1.0f, float rotation = 0.0f) const;
68  QSizeF size() const;
69  void setTransparentRendering(bool enable);
70  void setBackgroundColor(int r, int g, int b, int a = 255);
71  QString text(const QRectF &rect) const;
72  QList<TextBox *> textList() const;
73 
74 private:
75  Page(PagePrivate *pagep)
76  : d(pagep)
77  {
78 
79  }
80 
81  PagePrivate *d;
82 
83 friend class Document;
84 };
85 
86 } // end namespace MuPDF
87 
88 #endif // end MUPDF_PAGE_H