9 #ifndef Scribus_pdfwriter_h
10 #define Scribus_pdfwriter_h
13 #include <QDataStream>
21 #include "pdfstructs.h"
22 #include "scstreamfilter.h"
28 bool isWhiteSpace(
char c);
29 bool isDelimiter(
char c);
30 bool isRegular(
char c);
35 QByteArray toPdfDocEncoding(QString s);
40 QByteArray toUTF16(QString s);
45 QByteArray toAscii(QString s);
50 QByteArray toPdf(
bool v);
55 QByteArray toPdf(
int v);
60 QByteArray toPdf(uint v);
65 QByteArray toPdf(qlonglong v);
70 QByteArray toPdf(qulonglong v);
75 QByteArray toPdf(
double v);
80 QByteArray toObjRef(PdfId
id);
86 QByteArray toLiteralString(QByteArray s);
87 QByteArray toLiteralString(QString s);
92 QByteArray toHexString(QByteArray s);
97 QByteArray toHexString8(quint8 b);
102 QByteArray toHexString16(quint16 b);
107 QByteArray toHexString32(quint32 b);
114 QByteArray toName(QByteArray s);
115 QByteArray toName(QString s);
120 QByteArray toDateString(QDateTime dt);
125 QByteArray toRectangleArray(QRect r);
126 QByteArray toRectangleArray(QRectF r);
152 bool open (
const QString& filename);
153 QDataStream& getOutStream() {
return outStream; }
154 bool close(
bool aborted);
155 qint64 bytesWritten() {
return Spool.pos(); }
158 void setFileId(
const QByteArray&
id);
159 void setEncryption(
bool keylen16,
const QByteArray& ownerKey,
const QByteArray& userKey,
int permissions);
160 QByteArray encryptBytes(
const QByteArray& in, PdfId objNum);
162 QByteArray ComputeRC4Key(PdfId ObjNum);
164 void CalcOwnerKey(
const QByteArray & Owner,
const QByteArray & User);
165 void CalcUserKey(
const QByteArray & User,
int Permission);
166 QByteArray FitKey(
const QByteArray & pass);
170 void writeHeader(PDFOptions::PDFVersion vers);
171 void writeXrefAndTrailer();
172 void write(
const QByteArray& bytes);
174 void write(
const PdfFont font);
177 PdfId reserveObjects(
unsigned int n);
179 PdfId newObject() {
return reserveObjects(1); }
181 void startObj(PdfId
id);
184 PdfId res = newObject(); startObj(res);
return res;
187 void endObj(PdfId
id);
188 void endObjectWithStream(
bool encrypted, PdfId
id,
const QByteArray& streamContent);
201 PdfId OCPropertiesObj;
202 PdfId OutputIntentObj;
212 QDataStream outStream;
Definition: pdfstructs.h:31
Definition: pdfstructs.h:22
Definition: pdfwriter.h:146
Definition: pdfstructs.h:156
Definition: scstreamfilter.h:14
Defines class PDFOptions, used for loading/saving/passing around PDF options.