~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/include/ipepdfwriter.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2005-02-24 22:09:16 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050224220916-9vxiiqjz066r5489
Tags: 6.0pre23-2
debian/control: Ipe should depend on exact version of libipe.
Closes: #296771.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
// --------------------------------------------------------------------
 
3
// Creating PDF output
 
4
// --------------------------------------------------------------------
 
5
/*
 
6
 
 
7
    This file is part of the extensible drawing editor Ipe.
 
8
    Copyright (C) 1993-2004  Otfried Cheong
 
9
 
 
10
    Ipe is free software; you can redistribute it and/or modify it
 
11
    under the terms of the GNU General Public License as published by
 
12
    the Free Software Foundation; either version 2 of the License, or
 
13
    (at your option) any later version.
 
14
 
 
15
    As a special exception, you have permission to link Ipe with the
 
16
    CGAL library and distribute executables, as long as you follow the
 
17
    requirements of the Gnu General Public License in regard to all of
 
18
    the software in the executable aside from CGAL.
 
19
 
 
20
    Ipe is distributed in the hope that it will be useful, but WITHOUT
 
21
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
22
    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 
23
    License for more details.
 
24
 
 
25
    You should have received a copy of the GNU General Public License
 
26
    along with Ipe; if not, you can find it at
 
27
    "http://www.gnu.org/copyleft/gpl.html", or write to the Free
 
28
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
29
 
 
30
*/
 
31
 
 
32
#ifndef IPEPDFWRITER_H
 
33
#define IPEPDFWRITER_H
 
34
 
 
35
#include "ipebase.h"
 
36
#include "ipepage.h"
 
37
#include "ipedoc.h"
 
38
#include "ipeimage.h"
 
39
 
 
40
class IpeFontPool;
 
41
 
 
42
// --------------------------------------------------------------------
 
43
 
 
44
class IpePdfWriter {
 
45
public:
 
46
  IpePdfWriter(IpeTellStream &stream, const IpeDocument *doc,
 
47
               bool noShading, int compression);
 
48
  ~IpePdfWriter();
 
49
 
 
50
  void EmbedFonts(const IpeFontPool *pool);
 
51
  void CreatePages(bool lastView);
 
52
  void CreateBookmarks();
 
53
  void CreateXmlStream(IpeString xmldata, bool preCompressed);
 
54
  void CreateTrailer(IpeString creator);
 
55
 
 
56
private:
 
57
  void CreatePageView(int page, int view);
 
58
  int StartObject(int objnum = -1);
 
59
  void CreateStream(const char *data, int size, bool preCompressed);
 
60
  void WriteString(IpeString text);
 
61
  void EmbedBitmap(IpeBitmap bitmap);
 
62
  IpeRect PaintView(IpeStream &stream, const IpePage *page, int view);
 
63
 
 
64
private:
 
65
  IpeTellStream &iStream;
 
66
  const IpeDocument *iDoc;
 
67
  //! Obj id of XML stream.
 
68
  int iXmlStreamNum;
 
69
  //! Obj id of font resource dictionary.
 
70
  int iResourceNum;
 
71
  //! Obj id of shading dictionary.
 
72
  int iShadingNum;
 
73
  //! Obj id of outline dictionary.
 
74
  int iBookmarks;
 
75
  //! Compression level (0..9).
 
76
  int iCompressLevel;
 
77
 
 
78
  std::vector<IpeBitmap> iBitmaps;
 
79
  //! Next unused PDF object number.
 
80
  int iObjNum;
 
81
  //! List of pages, expressed as Pdf object numbers.
 
82
  std::vector<int> iPageObjectNumbers;
 
83
  //! List of file locations, in object number order (starting with 0).
 
84
  std::map<int, long> iXref;
 
85
};
 
86
 
 
87
// --------------------------------------------------------------------
 
88
#endif