12 #include <QDataStream>
30 class MultiProgressDialog;
35 #include "pdfstructs.h"
36 #include "scribusstructs.h"
37 #include "scimagestructs.h"
38 #include "tableborder.h"
41 #include <podofo/podofo.h>
44 #include "pdfwriter.h"
65 bool doExport(
const QString& fn,
const QString& nam,
int Components,
66 const std::vector<int> & pageNs,
const QMap<int,QPixmap> & thumbs);
68 const QString& errorMessage(
void)
const;
69 bool exportAborted(
void)
const;
85 QMap<int, ImageLoadRequest> RequestProps;
89 bool PDF_IsPDFX(PDFOptions::PDFVersion ver);
91 bool PDF_Begin_Doc(
const QString& fn,
SCFonts &AllFonts,
const QMap<QString, QMap<uint, FPointArray> >& DocFonts,
BookMView* vi);
92 void PDF_Begin_Catalog();
93 void PDF_Begin_MetadataAndEncrypt();
94 QMap<QString, QMap<uint, FPointArray> >
95 PDF_Begin_FindUsedFonts(
SCFonts &AllFonts,
const QMap<QString, QMap<uint, FPointArray> >& DocFonts);
96 void PDF_Begin_WriteUsedFonts(
SCFonts &AllFonts,
const QMap<QString, QMap<uint, FPointArray> >& ReallyUsed);
97 void PDF_WriteStandardFonts();
98 PdfFont PDF_WriteType3Font(
const QByteArray& name,
ScFace& face,
const QMap<uint,FPointArray>& RealGlyphs);
99 PdfFont PDF_WriteGlyphsAsXForms(
const QByteArray& fontName,
ScFace& face,
const QMap<uint,FPointArray>& RealGlyphs);
101 PdfId PDF_WriteFontDescriptor(
const QByteArray& fontName,
ScFace& face, ScFace::FontFormat fformat, PdfId embeddedFontObject);
102 PdfFont PDF_WriteTtfSubsetFont(
const QByteArray& fontName,
ScFace& face,
const QMap<uint,FPointArray>& RealGlyphs);
103 PdfFont PDF_WriteCffSubsetFont(
const QByteArray& fontName,
ScFace& face,
const QMap<uint,FPointArray>& RealGlyphs);
104 PdfFont PDF_EncodeSimpleFont(
const QByteArray& fontname,
ScFace& face,
const QByteArray& baseFont,
const QByteArray& subtype,
bool isEmbedded, PdfId fontDes,
const ScFace::FaceEncoding& gl);
105 PdfFont PDF_EncodeCidFont(
const QByteArray& fontname,
ScFace& face,
const QByteArray& baseFont, PdfId fontDes,
const ScFace::FaceEncoding& gl,
const QMap<uint,uint> glyphmap);
106 PdfId PDF_EmbedFontObject(
const QString& fontName,
ScFace &face);
107 PdfId PDF_EmbedFontObject(
const QByteArray& ttf,
const QByteArray& subtype);
108 PdfId PDF_EmbedType1AsciiFontObject(
const QByteArray& fontData);
109 PdfId PDF_EmbedType1BinaryFontObject(
const QByteArray& fontData);
110 void PDF_Begin_Colors();
111 void PDF_Begin_Layers();
113 void PDF_Begin_Page(
const ScPage* pag, QPixmap pm);
114 void PDF_End_Page(
int physPage);
115 bool PDF_TemplatePage(
const ScPage* pag,
bool clip =
false);
116 bool PDF_ProcessPage(
const ScPage* pag, uint PNr,
bool clip =
false);
117 bool PDF_ProcessMasterElements(
const ScLayer& layer,
const ScPage* page, uint PNr);
118 bool PDF_ProcessPageElements(
const ScLayer& layer,
const ScPage* page, uint PNr);
120 bool PDF_End_Doc(
const QString& PrintPr =
"",
const QString& Name =
"",
int Components = 0);
121 void PDF_End_Bookmarks();
122 void PDF_End_Resources();
123 void PDF_End_Outlines();
124 void PDF_End_PageTree();
125 void PDF_End_NamedDests();
126 void PDF_End_FormObjects();
127 void PDF_End_JavaScripts();
128 void PDF_End_Articles();
129 void PDF_End_Layers();
130 void PDF_End_OutputProfile(
const QString& PrintPr,
const QString& Name,
int Components);
131 void PDF_End_Metadata();
132 bool PDF_End_XRefAndTrailer();
133 bool closeAndCleanup();
135 void PDF_Error(
const QString& errorMsg);
136 void PDF_Error_WriteFailure(
void);
137 void PDF_Error_ImageLoadFailure(
const QString& fileName);
138 void PDF_Error_ImageWriteFailure(
const QString& fileName);
139 void PDF_Error_MaskLoadFailure(
const QString& fileName);
140 void PDF_Error_InsufficientMemory(
void);
143 QByteArray EncStream(
const QByteArray & in, PdfId ObjNum);
144 QByteArray EncString(
const QByteArray & in, PdfId ObjNum);
145 QByteArray EncStringUTF16(
const QString & in, PdfId ObjNum);
147 bool EncodeArrayToStream(
const QByteArray& in, PdfId ObjNum);
149 int WriteImageToStream(
ScImage& image, PdfId ObjNum, ColorSpaceEnum format,
bool precal);
150 int WriteJPEGImageToStream(
ScImage& image,
const QString& fn, PdfId ObjNum,
int quality, ColorSpaceEnum format,
bool sameFile,
bool precal);
151 int WriteFlateImageToStream(
ScImage& image, PdfId ObjNum, ColorSpaceEnum format,
bool precal);
157 QByteArray SetClipPath(
PageItem *ite,
bool poly =
true);
158 QByteArray SetClipPathArray(
FPointArray *ite,
bool poly =
true);
159 QByteArray SetClipPathImage(
PageItem *ite);
161 QByteArray SetImagePathAndClip(
PageItem *item);
162 QByteArray SetPathAndClip(
PageItem *item);
163 QByteArray SetPathAndClip(
PageItem *item,
bool fillRule);
165 QByteArray setStrokeMulti(
struct SingleLine *sl);
166 QByteArray SetColor(
const QString& farbe,
double Shade);
167 QByteArray SetColor(
const ScColor& farbe,
double Shade);
168 QByteArray SetGradientColor(
const QString& farbe,
double Shade);
169 QByteArray putColor(
const QString& color,
double Shade,
bool fill);
170 QByteArray putColorUncached(
const QString& color,
int Shade,
bool fill);
171 QByteArray Write_FormXObject(QByteArray &data,
PageItem *controlItem = 0);
172 QByteArray Write_TransparencyGroup(
double trans,
int blend, QByteArray &data,
PageItem *controlItem = 0);
174 bool setTextCh(
PageItem *ite, uint PNr,
double x,
double y, uint d, QByteArray &tmp, QByteArray &tmp2,
const CharStyle& cstyle,
GlyphLayout *glyphs,
PathData* pdata,
const ParagraphStyle& pstyle,
const ScPage* pag);
175 void getBleeds(
const ScPage* page,
double &left,
double &right);
176 void getBleeds(
const ScPage* page,
double &left,
double &right,
double &bottom,
double& top);
185 void PutPage(
const QByteArray & in) { Content += in; }
188 uint WritePDFStream(
const QByteArray& cc);
189 uint WritePDFString(
const QString& cc);
190 void writeXObject(uint objNr, QByteArray dictionary, QByteArray stream);
191 uint writeObject(QByteArray type, QByteArray dictionary);
192 uint writeGState(QByteArray dictionary) {
return writeObject(
"/ExtGState", dictionary); }
193 uint writeActions(
const Annotation&, uint annotationObj);
199 bool PDF_ProcessItem(QByteArray& output,
PageItem* ite,
const ScPage* pag, uint PNr,
bool embedded =
false,
bool pattern =
false);
200 void PDF_Bookmark(
PageItem *currItem,
double ypos);
201 bool PDF_HatchFill(QByteArray& output,
PageItem *currItem);
202 bool PDF_PatternFillStroke(QByteArray& output,
PageItem *currItem,
int kind = 0,
bool forArrow =
false);
203 bool PDF_MeshGradientFill(QByteArray& output,
PageItem *currItem);
204 bool PDF_PatchMeshGradientFill(QByteArray& output,
PageItem *c);
205 bool PDF_DiamondGradientFill(QByteArray& output,
PageItem *currItem);
206 bool PDF_TensorGradientFill(QByteArray& output,
PageItem *currItem);
207 bool PDF_GradientFillStroke(QByteArray& output,
PageItem *currItem,
bool stroke =
false,
bool forArrow =
false);
208 QByteArray PDF_TransparenzFill(
PageItem *currItem);
209 QByteArray PDF_TransparenzStroke(
PageItem *currItem);
211 bool PDF_3DAnnotation(
PageItem *ite, uint PNr);
213 void PDF_RadioButtons();
214 uint PDF_RadioButton(
PageItem *ite, uint parent, QString parentName);
215 bool PDF_Annotation(
PageItem *ite, uint PNr);
216 void PDF_Form(
const QByteArray& im);
217 void PDF_xForm(uint objNr,
double w,
double h, QByteArray im);
218 bool PDF_Image(
PageItem* c,
const QString& fn,
double sx,
double sy,
double x,
double y,
bool fromAN =
false,
const QString& Profil =
"",
bool Embedded =
false, eRenderIntent Intent = Intent_Relative_Colorimetric, QByteArray* output = NULL);
219 bool PDF_EmbeddedPDF(
PageItem* c,
const QString& fn,
double sx,
double sy,
double x,
double y,
bool fromAN,
const QString& Profil,
bool Embedded,
int Intent, ShIm& imgInfo, QByteArray* output = NULL);
221 void copyPoDoFoObject(
const PoDoFo::PdfObject* obj, uint scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
222 void copyPoDoFoDirect(
const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
225 quint32 encode32dVal(
double val);
226 quint16 encode16dVal(
double val);
227 void encodeColor(QDataStream &vs, QString colName,
int colShade, QStringList &spotColorSet,
bool spotMode);
229 QByteArray drawArrow(
PageItem *ite, QTransform &arrowTrans,
int arrowIndex);
230 QByteArray createBorderAppearance(
PageItem *ite);
231 QByteArray paintBorder(
const TableBorder& border,
const QPointF& start,
const QPointF& end,
const QPointF& startOffsetFactors,
const QPointF& endOffsetFactors);
232 QByteArray handleBrushPattern(
PageItem* ite, QPainterPath &path,
const ScPage* pag, uint PNr);
234 void generateXMP(
const QString& timeStamp);
245 QString ErrorMessage;
251 QMap<QString,ShIm> SharedImages;
252 QList<PdfDest> NamedDest;
253 QList<PdfId> Threads;
254 QList<PdfBead> Beads;
255 QList<PdfId> CalcFields;
256 Pdf::ResourceMap Patterns;
257 Pdf::ResourceMap Shadings;
258 Pdf::ResourceMap Transpar;
259 QMap<QString,PdfICCD> ICCProfiles;
260 QHash<QString, PdfOCGInfo> OCGEntries;
261 QTextCodec* ucs2Codec;
267 QMap<QString, PdfFont> UsedFontsP;
268 QMap<QString, PdfFont> UsedFontsF;
279 QMap<QString, PdfSpotC> spotMap;
280 QMap<QString, PdfSpotC> spotMapReg;
284 QMap<QString, QString> StdFonts;
285 MultiProgressDialog* progressDialog;
288 double bleedDisplacementX;
289 double bleedDisplacementY;
290 QByteArray xmpPacket;
291 QStack<QPointF> groupStackPos;
292 QStack<QPointF> patternStackPos;
295 void cancelRequested();
Definition: charstyle.h:78
Definition: pdfstructs.h:69
Definition: scribusstructs.h:120
Definition: sctextstruct.h:109
Tree widget item for PDF Bookmarks. Secret items like Pare, First, Last etc. are PDF Outlines attribu...
Definition: bookmwin.h:40
Definition: tableborder.h:86
Definition: pdfstructs.h:54
Definition: paragraphstyle.h:27
Definition: sccolor.h:155
the Document Class
Definition: scribusdoc.h:90
Definition: pdfstructs.h:62
Definition: pdfwriter.h:146
Definition: pdflib_core.h:58
Definition: pdfstructs.h:156
Base Class ScFace : This is a total rewrite of the old Foi class.
Definition: scface.h:73
Definition: prefscontext.h:40
PDF Options struture. Capable of verifying its self, but otherwise largely a dumb struct...
Definition: pdfoptions.h:37
Tree widget for PDF Bookmarks. It's a minimal tree implementation with D'n'D handled in Qt4 itself...
Definition: bookmwin.h:75
Definition: pageitem.h:92
Definition: pdfstructs.h:82
Definition: annotation.h:35
Definition: textlayout.h:44
Definition: fpointarray.h:42
Defines class PDFOptions, used for loading/saving/passing around PDF options.
Definition: sctextstruct.h:54
Main class SCFonts. Subclass of QDict. This class replaces the previous SCFonts typedef...
Definition: scfonts.h:36