21#include "GlobalParams.h"
27class GfxSeparationColorSpace;
29class PSOutCustomColor;
48typedef void (*PSOutputFunc)( void *stream, char *data, int len);
50class PSOutputDev: public OutputDev {
54 PSOutputDev( char *fileName, XRef *xrefA, Catalog *catalog,
55 int firstPage, int lastPage, PSOutMode modeA);
58 PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA,
59 XRef *xrefA, Catalog *catalog,
60 int firstPage, int lastPage, PSOutMode modeA);
63 virtual ~PSOutputDev();
66 virtual GBool isOk() { return ok; }
72 virtual GBool upsideDown() { return gFalse; }
75 virtual GBool useDrawChar() { return gFalse; }
79 virtual GBool interpretType3Chars() { return gFalse; }
84 virtual void startPage( int pageNum, GfxState *state);
87 virtual void endPage();
90 virtual void saveState(GfxState *state);
91 virtual void restoreState(GfxState *state);
94 virtual void updateCTM(GfxState *state, double m11, double m12,
95 double m21, double m22, double m31, double m32);
96 virtual void updateLineDash(GfxState *state);
97 virtual void updateFlatness(GfxState *state);
98 virtual void updateLineJoin(GfxState *state);
99 virtual void updateLineCap(GfxState *state);
100 virtual void updateMiterLimit(GfxState *state);
101 virtual void updateLineWidth(GfxState *state);
102 virtual void updateFillColor(GfxState *state);
103 virtual void updateStrokeColor(GfxState *state);
106 virtual void updateFont(GfxState *state);
107 virtual void updateTextMat(GfxState *state);
108 virtual void updateCharSpace(GfxState *state);
109 virtual void updateRender(GfxState *state);
110 virtual void updateRise(GfxState *state);
111 virtual void updateWordSpace(GfxState *state);
112 virtual void updateHorizScaling(GfxState *state);
113 virtual void updateTextPos(GfxState *state);
114 virtual void updateTextShift(GfxState *state, double shift);
117 virtual void stroke(GfxState *state);
118 virtual void fill(GfxState *state);
119 virtual void eoFill(GfxState *state);
122 virtual void clip(GfxState *state);
123 virtual void eoClip(GfxState *state);
126 virtual void drawString(GfxState *state, GString *s);
129 virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
130 int width, int height, GBool invert,
132 virtual void drawImage(GfxState *state, Object *ref, Stream *str,
133 int width, int height, GfxImageColorMap *colorMap,
134 int *maskColors, GBool inlineImg);
138 virtual void opiBegin(GfxState *state, Dict *opiDict);
139 virtual void opiEnd(GfxState *state, Dict *opiDict);
143 virtual void type3D0(GfxState *state, double wx, double wy);
144 virtual void type3D1(GfxState *state, double wx, double wy,
145 double llx, double lly, double urx, double ury);
148 virtual void psXObject(Stream *psStream, Stream *level1Stream);
153 void init(PSOutputFunc outputFuncA, void *outputStreamA,
154 PSFileType fileTypeA, XRef *xrefA, Catalog *catalog,
155 int firstPage, int lastPage, PSOutMode modeA);
156 void setupResources(Dict *resDict);
157 void setupFonts(Dict *resDict);
158 void setupFont(GfxFont *font, Dict *parentResDict);
159 void setupEmbeddedType1Font(Ref * id, char *psName);
160 void setupExternalType1Font(GString *fileName, char *psName);
161 void setupEmbeddedType1CFont(GfxFont *font, Ref * id, char *psName);
162 void setupEmbeddedTrueTypeFont(GfxFont *font, Ref * id, char *psName);
163 void setupExternalTrueTypeFont(GfxFont *font, char *psName);
164 void setupEmbeddedCIDType0Font(GfxFont *font, Ref * id, char *psName);
165 void setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref * id, char *psName);
166 void setupType3Font(GfxFont *font, char *psName, Dict *parentResDict);
167 void setupImages(Dict *resDict);
168 void setupImage(Ref id, Stream *str);
169 void addProcessColor( double c, double m, double y, double k);
170 void addCustomColor(GfxSeparationColorSpace *sepCS);
171 void doPath(GfxPath *path);
172 void doImageL1(GfxImageColorMap *colorMap,
173 GBool invert, GBool inlineImg,
174 Stream *str, int width, int height, int len);
175 void doImageL1Sep(GfxImageColorMap *colorMap,
176 GBool invert, GBool inlineImg,
177 Stream *str, int width, int height, int len);
178 void doImageL2(Object *ref, GfxImageColorMap *colorMap,
179 GBool invert, GBool inlineImg,
180 Stream *str, int width, int height, int len);
181 void dumpColorSpaceL2(GfxColorSpace *colorSpace);
183 void opiBegin20(GfxState *state, Dict *dict);
184 void opiBegin13(GfxState *state, Dict *dict);
185 void opiTransform(GfxState *state, double x0, double y0,
186 double *x1, double *y1);
187 GBool getFileSpec(Object *fileSpec, Object *fileName);
189 void writePSChar( char c);
190 void writePS( char *s);
191 void writePSFmt( const char *fmt, ...);
192 void writePSString(GString *s);
193 void writePSName( char *s);
194 GString *filterPSName(GString *name);
201 PSOutputFunc outputFunc;
214 GString **fontFileNames;
216 int fontFileNameSize;
217 PSFont16Enc *font16Enc;
222 double xScale, yScale;
225 GString *embFontList;
234 t3LLX, t3LLY, t3URX, t3URY;
|