Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/PSOutputDev.h
diff options
context:
space:
mode:
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 22:20:42 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 22:20:42 (GMT)
commit2a393c134fe3fe8eb85bf818cb7ad6ae4396322a (patch)
treeeba8b0dcaba42d799ed8313faee15fb74a5a0cd2 /pdf/xpdf/PSOutputDev.h
parent7aac8dc8533347e21311b15186e0af82f1b22fd6 (diff)
Synched with Xpdf 1.01
Diffstat (limited to 'pdf/xpdf/PSOutputDev.h')
-rw-r--r--pdf/xpdf/PSOutputDev.h92
1 files changed, 58 insertions, 34 deletions
diff --git a/pdf/xpdf/PSOutputDev.h b/pdf/xpdf/PSOutputDev.h
index d23d19e..ba208de 100644
--- a/pdf/xpdf/PSOutputDev.h
+++ b/pdf/xpdf/PSOutputDev.h
@@ -2,7 +2,7 @@
//
// PSOutputDev.h
//
-// Copyright 1996 Derek B. Noonburg
+// Copyright 1996-2002 Glyph & Cog, LLC
//
//========================================================================
@@ -16,38 +16,26 @@
#include <stddef.h>
#include "config.h"
#include "Object.h"
+#include "GlobalParams.h"
#include "OutputDev.h"
class GfxPath;
class GfxFont;
class GfxColorSpace;
-
-//------------------------------------------------------------------------
-// Parameters
-//------------------------------------------------------------------------
-
-// Generate Level 1 PostScript?
-extern GBool psOutLevel1;
-
-// Generate Level 1 separable PostScript?
-extern GBool psOutLevel1Sep;
-
-// Generate Encapsulated PostScript?
-extern GBool psOutEPS;
-
-#if OPI_SUPPORT
-// Generate OPI comments?
-extern GBool psOutOPI;
-#endif
-
-// Paper size.
-extern int paperWidth;
-extern int paperHeight;
+class GfxSeparationColorSpace;
+struct PSFont16Enc;
+class PSOutCustomColor;
//------------------------------------------------------------------------
// PSOutputDev
//------------------------------------------------------------------------
+enum PSOutMode {
+ psModePS,
+ psModeEPS,
+ psModeForm
+};
+
enum PSFileType {
psFile, // write to file
psPipe, // write to pipe
@@ -58,9 +46,8 @@ class PSOutputDev: public OutputDev {
public:
// Open a PostScript output file, and write the prolog.
- PSOutputDev(char *fileName, Catalog *catalog,
- int firstPage, int lastPage,
- GBool embedType11, GBool doForm1);
+ PSOutputDev(char *fileName, XRef *xrefA, Catalog *catalog,
+ int firstPage, int lastPage, PSOutMode modeA);
// Destructor -- writes the trailer and closes the file.
virtual ~PSOutputDev();
@@ -77,6 +64,10 @@ public:
// Does this device use drawChar() or drawString()?
virtual GBool useDrawChar() { return gFalse; }
+ // Does this device use beginType3Char/endType3Char? Otherwise,
+ // text in Type 3 fonts will be drawn with drawChar/drawString.
+ virtual GBool interpretType3Chars() { return gFalse; }
+
//----- initialization and control
// Start a page.
@@ -123,7 +114,6 @@ public:
//----- text drawing
virtual void drawString(GfxState *state, GString *s);
- virtual void drawString16(GfxState *state, GString *s);
//----- image drawing
virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
@@ -131,7 +121,7 @@ public:
GBool inlineImg);
virtual void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- GBool inlineImg);
+ int *maskColors, GBool inlineImg);
#if OPI_SUPPORT
//----- OPI functions
@@ -139,16 +129,31 @@ public:
virtual void opiEnd(GfxState *state, Dict *opiDict);
#endif
+ //----- Type 3 font operators
+ virtual void type3D0(GfxState *state, double wx, double wy);
+ virtual void type3D1(GfxState *state, double wx, double wy,
+ double llx, double lly, double urx, double ury);
+
+ //----- PostScript XObjects
+ virtual void psXObject(Stream *psStream, Stream *level1Stream);
+
private:
void setupResources(Dict *resDict);
void setupFonts(Dict *resDict);
- void setupFont(GfxFont *font);
+ void setupFont(GfxFont *font, Dict *parentResDict);
void setupEmbeddedType1Font(Ref *id, char *psName);
- void setupEmbeddedType1Font(GString *fileName, char *psName);
+ void setupExternalType1Font(GString *fileName, char *psName);
void setupEmbeddedType1CFont(GfxFont *font, Ref *id, char *psName);
+ void setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id, char *psName);
+ void setupExternalTrueTypeFont(GfxFont *font, char *psName);
+ void setupEmbeddedCIDType0Font(GfxFont *font, Ref *id, char *psName);
+ void setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id, char *psName);
+ void setupType3Font(GfxFont *font, char *psName, Dict *parentResDict);
void setupImages(Dict *resDict);
void setupImage(Ref id, Stream *str);
+ void addProcessColor(double c, double m, double y, double k);
+ void addCustomColor(GfxSeparationColorSpace *sepCS);
void doPath(GfxPath *path);
void doImageL1(GfxImageColorMap *colorMap,
GBool invert, GBool inlineImg,
@@ -160,21 +165,29 @@ private:
GBool invert, GBool inlineImg,
Stream *str, int width, int height, int len);
void dumpColorSpaceL2(GfxColorSpace *colorSpace);
+#if OPI_SUPPORT
void opiBegin20(GfxState *state, Dict *dict);
void opiBegin13(GfxState *state, Dict *dict);
void opiTransform(GfxState *state, double x0, double y0,
double *x1, double *y1);
GBool getFileSpec(Object *fileSpec, Object *fileName);
+#endif
void writePS(const char *fmt, ...);
void writePSString(GString *s);
+ void writePSChar(char c);
+ GString *filterPSName(GString *name);
- GBool embedType1; // embed Type 1 fonts?
- GBool doForm; // generate a form?
+ PSLevel level; // PostScript level (1, 2, separation)
+ PSOutMode mode; // PostScript mode (PS, EPS, form)
+ int paperWidth; // width of paper, in pts
+ int paperHeight; // height of paper, in pts
FILE *f; // PostScript file
PSFileType fileType; // file / pipe / stdout
int seqPage; // current sequential page number
+ XRef *xref; // the xref table for this PDF file
+
Ref *fontIDs; // list of object IDs of all used fonts
int fontIDLen; // number of entries in fontIDs array
int fontIDSize; // size of fontIDs array
@@ -184,6 +197,9 @@ private:
GString **fontFileNames; // list of names of all embedded external fonts
int fontFileNameLen; // number of entries in fontFileNames array
int fontFileNameSize; // size of fontFileNames array
+ PSFont16Enc *font16Enc; // encodings for substitute 16-bit fonts
+ int font16EncLen; // number of entries in font16Enc array
+ int font16EncSize; // size of font16Enc array
double tx, ty; // global translation
double xScale, yScale; // global scaling
@@ -191,13 +207,21 @@ private:
GString *embFontList; // resource comments for embedded fonts
+ int processColors; // used process colors
+ PSOutCustomColor // used custom colors
+ *customColors;
+
+ GBool inType3Char; // inside a Type 3 CharProc
+ GString *t3String; // Type 3 content string
+ double t3WX, t3WY, // Type 3 character parameters
+ t3LLX, t3LLY, t3URX, t3URY;
+ GBool t3Cacheable; // cleared if char is not cacheable
+
#if OPI_SUPPORT
int opi13Nest; // nesting level of OPI 1.3 objects
int opi20Nest; // nesting level of OPI 2.0 objects
#endif
- GBool type3Warning; // only show the Type 3 font warning once
-
GBool ok; // set up ok?
};