• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef QPDF_PDFTOPDF_H
2 #define QPDF_PDFTOPDF_H
3 
4 #include <qpdf/QPDFObjectHandle.hh>
5 #include "pptypes.h"
6 
7 // helper functions
8 
9 PageRect getBoxAsRect(QPDFObjectHandle box);
10 QPDFObjectHandle getRectAsBox(const PageRect &rect);
11 
12 // Note that PDF specification is CW, but our Rotation is CCW
13 Rotation getRotate(QPDFObjectHandle page);
14 QPDFObjectHandle makeRotate(Rotation rot); // Integer
15 
16 double getUserUnit(QPDFObjectHandle page);
17 
18 // PDF CTM
19 class Matrix {
20  public:
21   Matrix(); // identity
22   Matrix(QPDFObjectHandle ar);
23 
24   Matrix &rotate(Rotation rot);
25   Matrix &rotate_move(Rotation rot,double width,double height);
26   Matrix &rotate(double rad);
27   //  Matrix &rotate_deg(double deg);
28 
29   Matrix &translate(double tx,double ty);
30   Matrix &scale(double sx,double sy);
scale(double s)31   Matrix &scale(double s) { return scale(s,s); }
32 
33   Matrix &operator*=(const Matrix &rhs);
34 
35   QPDFObjectHandle get() const;
36   std::string get_string() const;
37  private:
38   double ctm[6];
39 };
40 
41 #endif
42