Scribus
Open source desktop publishing at your fingertips
importpdf.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef IMPORTPDF_H
8 #define IMPORTPDF_H
9 
10 
11 #include "pluginapi.h"
12 #include "pageitem.h"
13 #include "sccolor.h"
14 #include "fpointarray.h"
15 #include <QList>
16 #include <QTransform>
17 #include <QMultiMap>
18 #include <QtGlobal>
19 #include <QObject>
20 #include <QString>
21 #include <QTextStream>
22 #include <QSizeF>
23 #include <QBuffer>
24 #include <QColor>
25 #include <QBrush>
26 #include <QPen>
27 #include <QImage>
28 
29 
30 class QColor;
31 class QMatrix;
32 
33 class MultiProgressDialog;
34 class ScribusDoc;
35 class Selection;
37 
38 class GooString;
39 class PDFDoc;
40 
42 class PdfPlug : public QObject
43 {
44  Q_OBJECT
45 
46 public:
56  PdfPlug( ScribusDoc* doc, int flags );
57  ~PdfPlug();
58 
69  bool import(QString fn, const TransactionSettings& trSettings, int flags, bool showProgress = true);
70  QImage readThumbnail(QString fn);
71  QImage readPreview(int pgNum, int width, int height, int box);
72  enum PDF_Box_Type
73  {
74  Media_Box = 0,
75  Bleed_Box = 1,
76  Trim_Box = 2,
77  Crop_Box = 3,
78  Art_Box = 4
79  };
80 
81 private:
82  bool convert(QString fn);
83  QRectF getCBox(int box, int pgNum);
84  QString UnicodeParsedString(GooString *s1);
85 
86  QList<PageItem*> Elements;
87  double baseX, baseY;
88  double docWidth;
89  double docHeight;
90  qreal scPg;
91 
92  QStringList importedColors;
93 
94  bool interactive;
95  MultiProgressDialog * progressDialog;
96  bool cancel;
97  ScribusDoc* m_Doc;
98  Selection* tmpSele;
99  int importerFlags;
100  int oldDocItemCount;
101  QString baseFile;
102  PDFDoc *m_pdfDoc;
103 
104 public slots:
105  void cancelRequested() { cancel = true; }
106 };
107 
108 #endif
PdfPlug(ScribusDoc *doc, int flags)
Create the PDF importer window.
Definition: importpdf.cpp:62
PDF importer plugin.
Definition: importpdf.h:42
the Document Class
Definition: scribusdoc.h:90
Definition: undomanager.h:52
Definition: selection.h:34