Rev 3829 | Rev 4028 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3133 | fschmid | 1 | /*************************************************************************** |
2 | pdflib.h - description |
||
3 | ------------------- |
||
4 | begin : Sat Jan 19 2002 |
||
5 | copyright : (C) 2002 by Franz Schmid |
||
6 | email : Franz.Schmid@altmuehlnet.de |
||
7 | ***************************************************************************/ |
||
8 | |||
9 | /*************************************************************************** |
||
10 | * * |
||
11 | * This program is free software; you can redistribute it and/or modify * |
||
12 | * it under the terms of the GNU General Public License as published by * |
||
13 | * the Free Software Foundation; either version 2 of the License, or * |
||
14 | * (at your option) any later version. * |
||
15 | * * |
||
16 | ***************************************************************************/ |
||
17 | |||
18 | #ifndef PDFLIB_H |
||
19 | #define PDFLIB_H |
||
20 | |||
21 | #include "qvaluelist.h" |
||
22 | #include <qfile.h> |
||
3699 | cbradney | 23 | #include <vector> |
3133 | fschmid | 24 | |
25 | class QString; |
||
26 | class QRect; |
||
27 | class QImage; |
||
28 | class QProgressBar; |
||
29 | class PageItem; |
||
30 | class BookMItem; |
||
31 | class BookMView; |
||
32 | class ScribusDoc; |
||
33 | class Page; |
||
34 | class PDFOptions; |
||
3252 | craig | 35 | class PrefsContext; |
3699 | cbradney | 36 | |
3133 | fschmid | 37 | #include "scribusstructs.h" |
38 | |||
39 | /** |
||
40 | *@author Franz Schmid |
||
41 | */ |
||
42 | |||
43 | class SCRIBUS_API PDFlib : public QObject |
||
44 | { |
||
45 | Q_OBJECT |
||
46 | |||
47 | public: |
||
3137 | fschmid | 48 | PDFlib(ScribusDoc *docu); |
3133 | fschmid | 49 | ~PDFlib() {}; |
3829 | cbradney | 50 | bool doExport(const QString& fn, const QString& nam, int Components, std::vector<int> &pageNs, QMap<int,QPixmap> thumbs, QProgressBar *dia2); |
51 | bool PDF_Begin_Doc(const QString& fn, PDFOptions *opts, SCFonts &AllFonts, QMap<QString,int> DocFonts, BookMView* vi); |
||
3133 | fschmid | 52 | void PDF_Begin_Page(Page* pag, QPixmap pm = 0); |
53 | void PDF_End_Page(); |
||
54 | void PDF_TemplatePage(Page* pag, bool clip = false); |
||
55 | void PDF_ProcessPage(Page* pag, uint PNr, bool clip = false); |
||
3829 | cbradney | 56 | void PDF_End_Doc(const QString& PrintPr = "", const QString& Name = "", int Components = 0); |
3133 | fschmid | 57 | struct GlNamInd |
58 | { |
||
59 | uint Code; |
||
60 | QString Name; |
||
61 | }; |
||
62 | typedef QMap<uint, GlNamInd> GListeInd; |
||
63 | QMap<QString, GListeInd> GlyphsIdxOfFont; |
||
64 | |||
65 | private: |
||
66 | QString EncStream(QString *in, int ObjNum); |
||
67 | QString EncString(QString in, int ObjNum); |
||
68 | void CalcOwnerKey(QString Owner, QString User); |
||
69 | void CalcUserKey(QString User, int Permission); |
||
70 | QString FitKey(QString pass); |
||
71 | QString FToStr(double c); |
||
72 | QString IToStr(int c); |
||
73 | QString setStrokeMulti(struct SingleLine *sl); |
||
74 | QString SetClipPathArray(FPointArray *ite, bool poly = true); |
||
75 | QString SetClipPathImage(PageItem *ite); |
||
76 | QString SetClipPath(PageItem *ite, bool poly = true); |
||
3829 | cbradney | 77 | QString SetFarbe(const QString& farbe, int Shade); |
78 | QString putColor(const QString& color, int Shade, bool fill); |
||
3133 | fschmid | 79 | QString PDF_ProcessItem(PageItem* ite, Page* pag, uint PNr, bool embedded = false); |
80 | QString setTextSt(PageItem *ite, uint PNr, Page* pag); |
||
81 | void setTextCh(PageItem *ite, uint PNr, uint d, QString &tmp, QString &tmp2, struct ScText *hl, Page* pag); |
||
82 | void PutDoc(QString in); |
||
83 | void PutPage(QString in); |
||
84 | void StartObj(int nr); |
||
85 | void WritePDFStream(QString *cc); |
||
86 | QString PDFEncode(QString in); |
||
3829 | cbradney | 87 | QByteArray ComputeMD5(const QString& in); |
3133 | fschmid | 88 | void PDF_Bookmark(int nr, double ypos); |
89 | QString PDF_Gradient(PageItem *currItem); |
||
3829 | cbradney | 90 | QString PDF_DoLinGradient(PageItem *currItem, QValueList<double> Stops, QValueList<double> Trans, const QStringList& Colors); |
3133 | fschmid | 91 | QString PDF_Transparenz(PageItem *currItem); |
92 | void PDF_Annotation(PageItem *ite, uint PNr); |
||
3829 | cbradney | 93 | void PDF_Form(QString& im); |
3133 | fschmid | 94 | void PDF_xForm(double w, double h, QString im); |
3829 | cbradney | 95 | QString PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN = false, const QString& Profil = "", bool Embedded = false, int Intent = 1); |
3133 | fschmid | 96 | QString Inhalt; |
97 | ScribusDoc* doc; |
||
98 | Page* ActPageP; |
||
99 | PDFOptions* Options; |
||
100 | BookMView* Bvie; |
||
101 | QFile Spool; |
||
102 | int Dokument; |
||
103 | struct Dest |
||
104 | { |
||
105 | QString Name; |
||
106 | int Seite; |
||
107 | QString Act; |
||
108 | }; |
||
109 | struct Cata |
||
110 | { |
||
111 | int Outlines; |
||
112 | int PageTree; |
||
113 | int Dest; |
||
114 | } |
||
115 | Catalog; |
||
116 | struct PagT |
||
117 | { |
||
118 | QValueList<int> Kids; |
||
119 | int Count; |
||
120 | } |
||
121 | PageTree; |
||
122 | struct PagL |
||
123 | { |
||
124 | int ObjNum; |
||
125 | int Thumb; |
||
126 | QMap<QString,int> XObjects; |
||
127 | QMap<QString,int> ImgObjects; |
||
128 | QMap<QString,int> FObjects; |
||
129 | QValueList<int> AObjects; |
||
130 | QValueList<int> FormObjects; |
||
131 | } |
||
132 | Seite; |
||
133 | struct OutL |
||
134 | { |
||
135 | int First; |
||
136 | int Last; |
||
137 | int Count; |
||
138 | } |
||
139 | Outlines; |
||
140 | struct Bead |
||
141 | { |
||
142 | int Parent; |
||
143 | int Next; |
||
144 | int Prev; |
||
145 | int Page; |
||
146 | QRect Recht; |
||
147 | }; |
||
148 | struct ICCD |
||
149 | { |
||
150 | int ResNum; |
||
151 | QString ResName; |
||
152 | QString ICCArray; |
||
153 | }; |
||
154 | struct ShIm |
||
155 | { |
||
156 | int ResNum; |
||
157 | int Width; |
||
158 | int Height; |
||
159 | double aufl; |
||
160 | double sxa; |
||
161 | double sya; |
||
162 | double xa; |
||
163 | double ya; |
||
164 | }; |
||
165 | struct OCGInfo |
||
166 | { |
||
167 | int ObjNum; |
||
168 | bool visible; |
||
169 | QString Name; |
||
170 | }; |
||
171 | struct SpotC |
||
172 | { |
||
173 | int ResNum; |
||
174 | QString ResName; |
||
175 | }; |
||
176 | QMap<QString,ShIm> SharedImages; |
||
177 | QValueList<uint> XRef; |
||
178 | QValueList<Dest> NamedDest; |
||
179 | QValueList<int> Threads; |
||
180 | QValueList<Bead> Beads; |
||
181 | QValueList<int> CalcFields; |
||
182 | QMap<QString,int> Shadings; |
||
183 | QMap<QString,int> Transpar; |
||
184 | QMap<QString,ICCD> ICCProfiles; |
||
185 | QMap<QString, OCGInfo> OCGEntries; |
||
186 | int ObjCounter; |
||
187 | QString ResNam; |
||
188 | int ResCount; |
||
189 | QString NDnam; |
||
190 | QString Datum; |
||
191 | int NDnum; |
||
192 | QMap<QString, QString> UsedFontsP; |
||
3544 | avox | 193 | QMap<QString, int> RealFonts; |
3133 | fschmid | 194 | bool CompAvail; |
195 | QByteArray KeyGen; |
||
196 | QByteArray OwnerKey; |
||
197 | QByteArray UserKey; |
||
198 | QByteArray FileID; |
||
199 | QByteArray EncryKey; |
||
200 | int Encrypt; |
||
201 | int KeyLen; |
||
202 | QString HTName; |
||
203 | bool BookMinUse; |
||
204 | ColorList colorsToUse; |
||
205 | QMap<QString, SpotC> spotMap; |
||
206 | QString spotNam; |
||
207 | int spotCount; |
||
3829 | cbradney | 208 | QTextStream t; |
4017 | fschmid | 209 | QMap<QString, QString> StdFonts; |
3133 | fschmid | 210 | }; |
211 | |||
212 | #endif |
||
213 |