1
// --------------------------------------------------------------------
2
// Utilities for clients of Xpdflib
3
// --------------------------------------------------------------------
6
This file is part of the extensible drawing editor Ipe.
7
Copyright (C) 1993-2004 Otfried Cheong
9
Ipe is free software; you can redistribute it and/or modify it
10
under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2 of the License, or
12
(at your option) any later version.
14
As a special exception, you have permission to link Ipe with the
15
CGAL library and distribute executables, as long as you follow the
16
requirements of the Gnu General Public License in regard to all of
17
the software in the executable aside from CGAL.
19
Ipe is distributed in the hope that it will be useful, but WITHOUT
20
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
22
License for more details.
24
You should have received a copy of the GNU General Public License
25
along with Ipe; if not, you can find it at
26
"http://www.gnu.org/copyleft/gpl.html", or write to the Free
27
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31
#include "ipepdflib_p.h"
33
static bool xpdflib_initialized = false;
37
if (!xpdflib_initialized) {
38
globalParams = new GlobalParams(0);
40
xpdflib_initialized = true;
43
IpeString PdfObject::String()
45
switch (iObject.getType()) {
48
IpeStringStream stream(res);
49
stream << iObject.getInt();
54
IpeStringStream stream(res);
55
stream << iObject.getReal();
59
return IpeString("/") + iObject.getName();
61
return IpeString("(") + iObject.getString()->getCString() + ")";
64
for (int i = 0; i < iObject.arrayGetLength(); i++) {
66
iObject.arrayGet(i, &elem);
67
res += elem.String() + " ";
73
IpeString res = "<< ";
74
for (int i = 0; i < iObject.dictGetLength(); i++) {
75
res += IpeString("/") + iObject.dictGetKey(i) + " ";
77
iObject.dictGetVal(i, &elem);
78
res += elem.String() + " ";