~ubuntu-branches/ubuntu/quantal/cups-filters/quantal-proposed

« back to all changes in this revision

Viewing changes to filter/pdftopdf/P2PDoc.h

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2012-08-20 14:53:42 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20120820145342-bddzpwqv0klmt84d
Tags: 1.0.22-1
* New upstream release
   - pdftopdf filter replaced by new QPDF-based filter from Tobias
     Hoffmann's Google Summer of Code project. The former Poppler-based
     pdftopdf duplicated a lot of Poppler's code. The old filter is
     still in the package as pdftopdf.old with source code in
     filter/pdftopdf.old. It will be removed in a later release.
   - bannertopdf: Page duplication routine fixed.
   - bannertopdf: Fixed invalid output of a direct stream object.
   - Added most recent contributors to AUTHORS and COPYING files.
* debian/control: Added build dependency on libqpdf-dev.
* debian/copyright: Updated for the addition of the new pdftopdf filter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 
3
 
Copyright (c) 2006-2007, BBR Inc.  All rights reserved.
4
 
 
5
 
Permission is hereby granted, free of charge, to any person obtaining
6
 
a copy of this software and associated documentation files (the
7
 
"Software"), to deal in the Software without restriction, including
8
 
without limitation the rights to use, copy, modify, merge, publish,
9
 
distribute, sublicense, and/or sell copies of the Software, and to
10
 
permit persons to whom the Software is furnished to do so, subject to
11
 
the following conditions:
12
 
 
13
 
The above copyright notice and this permission notice shall be included
14
 
in all copies or substantial portions of the Software.
15
 
 
16
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
 
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
 
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
 
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
 
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
 
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
 
 
24
 
*/
25
 
/*
26
 
 P2PDoc.h
27
 
 pdftopdf document
28
 
*/
29
 
#ifndef _P2PDOC_H_
30
 
#define _P2PDOC_H_
31
 
 
32
 
#include "PDFDoc.h"
33
 
#include "P2POutputStream.h"
34
 
#include "P2PPage.h"
35
 
 
36
 
#define PDFTOPDF_BORDERNONE     0 /* No border */
37
 
#define PDFTOPDF_BORDERHAIRLINE 1 /* hairline border */
38
 
#define PDFTOPDF_BORDERTHICK    2 /* thick border */
39
 
#define PDFTOPDF_BORDERDOUBLE   4 /* double line border */
40
 
 
41
 
#define PDFTOPDF_LAYOUT_LRBT    0 /* Left to right, bottom to top */
42
 
#define PDFTOPDF_LAYOUT_LRTB    1 /* Left to right, top to bottom */
43
 
#define PDFTOPDF_LAYOUT_RLBT    2 /* Right to left, bottom to top */
44
 
#define PDFTOPDF_LAYOUT_RLTB    3 /* Right to left, top to bottom */
45
 
#define PDFTOPDF_LAYOUT_BTLR    4 /* Bottom to top, left to right */
46
 
#define PDFTOPDF_LAYOUT_TBLR    5 /* Top to bottom, left to right */
47
 
#define PDFTOPDF_LAYOUT_BTRL    6 /* Bottom to top, right to left */
48
 
#define PDFTOPDF_LAYOUT_TBRL    7 /* Top to bottom, right to left */
49
 
 
50
 
#define PDFTOPDF_LAYOUT_NEGATEY 1 /* The bits for the layout */
51
 
#define PDFTOPDF_LAYOUT_NEGATEX 2 /* definitions above... */
52
 
#define PDFTOPDF_LAYOUT_VERTICAL 4
53
 
 
54
 
class P2PCatalog;
55
 
 
56
 
class P2PDoc {
57
 
public:
58
 
  struct Options {
59
 
    Options() {
60
 
      duplex = gFalse;
61
 
      copies = 1;
62
 
      collate = gFalse;
63
 
      user = 0;
64
 
      title = 0;
65
 
      jobId = 0;
66
 
      pageLabel = 0;
67
 
      pageRanges = 0;
68
 
      pageSet = 0;
69
 
      reverse = gFalse;
70
 
      even = gFalse;
71
 
      contentsCompress = gFalse;
72
 
      fontEmbedding = gFalse;
73
 
      fontEmbeddingWhole = gFalse;
74
 
      fontCompress = gFalse;
75
 
      numPreFonts = 0;
76
 
      preFonts = 0;
77
 
      fontEmbeddingPreLoad = gFalse;
78
 
    };
79
 
    ~Options() {}
80
 
 
81
 
    int orientation;
82
 
    GBool duplex;
83
 
    GBool collate;
84
 
    int copies;
85
 
    const char *user;
86
 
    const char *title;
87
 
    int jobId;
88
 
    const char *pageLabel;
89
 
    const char *pageRanges;
90
 
    const char *pageSet;
91
 
    GBool reverse;
92
 
    GBool even;
93
 
    GBool contentsCompress;
94
 
    GBool fontEmbedding;
95
 
    GBool fontEmbeddingWhole;
96
 
    GBool fontCompress;
97
 
    GBool fontEmbeddingPreLoad;
98
 
    GBool pdfPrinter;
99
 
    int numPreFonts;
100
 
    char **preFonts;
101
 
  };
102
 
 
103
 
  static Options options;
104
 
 
105
 
  P2PDoc(PDFDoc *orgDocA);
106
 
 
107
 
  virtual ~P2PDoc();
108
 
  void output(P2POutputStream *str, int deviceCopies = 0,
109
 
    bool deviceCollate = false);
110
 
  int nup(int n, PDFRectangle *box, unsigned int borderFlag,
111
 
    unsigned int layout, int xpos, int ypos);
112
 
  void select();
113
 
  void fit(PDFRectangle *box, double zoom);
114
 
  void mirror();
115
 
  void rotate(int orientation);
116
 
  void position(PDFRectangle *box, int xpos, int ypos);
117
 
  void scale(double zoom);
118
 
  void autoRotate(PDFRectangle *box);
119
 
  void setMediaBox(PDFRectangle *mediaBoxA);
120
 
  int getNumberOfPages();
121
 
private:
122
 
  PDFDoc *orgDoc;
123
 
  P2PCatalog *catalog;
124
 
};
125
 
 
126
 
#endif