~ubuntu-branches/ubuntu/jaunty/cups/jaunty

« back to all changes in this revision

Viewing changes to debian/local/filters/pdf-filters/pdftopdf/P2PDoc.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Till Kamppeter, Martin Pitt
  • Date: 2009-02-15 18:39:03 UTC
  • mfrom: (6.1.30 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090215183903-i0nhvqyqj4vyn52a
Tags: 1.3.9-13
[ Till Kamppeter ]
* debian/local/filters/pdf-filters/filter/imagetopdf.c: Added support for
  the new "fit-to-page" option (new, more intuitive name for "fitplot").
* debian/filters/pstopdf: Only apply paper size if the "fitplot" or the
  "fit-to-page" option is set.
* debian/local/filters/cpdftocps: Only the last digit of the number of
  copies was used (LP: #309314).
* debian/local/filters/pdf-filters/pdftopdf/pdftopdf.cxx: Do not preceed the
  PDF output with a newline (LP: #303691). Only impose the page size from
  the PPD file to all pages if the "fitplot" or the "fit-to-page" option is 
  set. This prevented from automatic paper tray switching to the correct paper
  sizes when a multiple-page-size document is printed (partial fix for
  LP: #310575).
* debian/patches/pdftops-cups-1.4.dpatch: Updated from CUPS 1.4 SVN. Contains
  fixes for multiple-page-size document printing (partial fix for
  LP: #310575).
* debian/patches/pdftops-dont_fail_on_cancel.dpatch: Removed, should be
  fixed in the new upstream version of pdftops.

[ Martin Pitt ]
* debian/patches/pdftops-cups-1.4.dpatch: Add definition of
  HAVE_PDFTOPS and CUPS_PDFTOPS, so that the filter actually gets
  again built with pdftops support. (Fixes Till's change from above).

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
    int numPreFonts;
 
99
    char **preFonts;
 
100
  };
 
101
 
 
102
  static Options options;
 
103
 
 
104
  P2PDoc(PDFDoc *orgDocA);
 
105
 
 
106
  virtual ~P2PDoc();
 
107
  void output(P2POutputStream *str, int deviceCopies = 0,
 
108
    bool deviceCollate = false);
 
109
  int nup(int n, PDFRectangle *box, unsigned int borderFlag,
 
110
    unsigned int layout, int xpos, int ypos);
 
111
  void select();
 
112
  void fit(PDFRectangle *box, double zoom);
 
113
  void mirror();
 
114
  void rotate(int orientation);
 
115
  void position(PDFRectangle *box, int xpos, int ypos);
 
116
  void scale(double zoom);
 
117
  void autoRotate(PDFRectangle *box);
 
118
  void setMediaBox(PDFRectangle *mediaBoxA);
 
119
  int getNumberOfPages();
 
120
private:
 
121
  PDFDoc *orgDoc;
 
122
  P2PCatalog *catalog;
 
123
};
 
124
 
 
125
#endif