1 //========================================================================
2 //
3 // PSOutputDev.h
4 //
5 // Copyright 1996-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8 
9 //========================================================================
10 //
11 // Modified under the Poppler project - http://poppler.freedesktop.org
12 //
13 // All changes made under the Poppler project to this file are licensed
14 // under GPL version 2 or later
15 //
16 // Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
17 // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
18 // Copyright (C) 2006-2008, 2012, 2013, 2015 Albert Astals Cid <aacid@kde.org>
19 // Copyright (C) 2007 Brad Hards <bradh@kde.org>
20 // Copyright (C) 2009-2013 Thomas Freitag <Thomas.Freitag@alfa.de>
21 // Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com>
22 // Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
23 // Copyright (C) 2009, 2011, 2015-2016 William Bader <williambader@hotmail.com>
24 // Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
25 // Copyright (C) 2011, 2014 Adrian Johnson <ajohnson@redneon.com>
26 // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
27 //
28 // To see a description of the changes please see the Changelog file that
29 // came with your tarball or type make ChangeLog if you are building from git
30 //
31 //========================================================================
32 
33 #ifndef PSOUTPUTDEV_H
34 #define PSOUTPUTDEV_H
35 
36 #ifdef USE_GCC_PRAGMAS
37 #pragma interface
38 #endif
39 
40 #include "poppler-config.h"
41 #include <stddef.h>
42 #include "Object.h"
43 #include "GfxState.h"
44 #include "GlobalParams.h"
45 #include "OutputDev.h"
46 #include <set>
47 #include <map>
48 #include <vector>
49 
50 class GHooash;
51 class PDFDoc;
52 class XRef;
53 class Function;
54 class GfxPath;
55 class GfxFont;
56 class GfxColorSpace;
57 class GfxSeparationColorSpace;
58 class PDFRectangle;
59 struct PST1FontName;
60 struct PSFont8Info;
61 struct PSFont16Enc;
62 class PSOutCustomColor;
63 class PSOutputDev;
64 
65 //------------------------------------------------------------------------
66 // PSOutputDev
67 //------------------------------------------------------------------------
68 
69 enum PSOutMode {
70   psModePS,
71   psModeEPS,
72   psModeForm
73 };
74 
75 enum PSFileType {
76   psFile,			// write to file
77   psPipe,			// write to pipe
78   psStdout,			// write to stdout
79   psGeneric			// write to a generic stream
80 };
81 
82 enum PSOutCustomCodeLocation {
83   psOutCustomDocSetup,
84   psOutCustomPageSetup
85 };
86 
87 typedef void (*PSOutputFunc)(void *stream, const char *data, int len);
88 
89 typedef GooString *(*PSOutCustomCodeCbk)(PSOutputDev *psOut,
90 				       PSOutCustomCodeLocation loc, int n,
91 				       void *data);
92 
93 class PSOutputDev: public OutputDev {
94 public:
95 
96   // Open a PostScript output file, and write the prolog.
97   // pages has to be sorted in increasing order
98   PSOutputDev(const char *fileName, PDFDoc *docA,
99 	      char *psTitleA,
100 	      const std::vector<int> &pages, PSOutMode modeA,
101 	      int paperWidthA = -1, int paperHeightA = -1,
102               GBool noCrop = gFalse,
103 	      GBool duplexA = gTrue,
104 	      int imgLLXA = 0, int imgLLYA = 0,
105 	      int imgURXA = 0, int imgURYA = 0,
106 	      GBool forceRasterizeA = gFalse,
107 	      GBool manualCtrlA = gFalse,
108 	      PSOutCustomCodeCbk customCodeCbkA = NULL,
109 	      void *customCodeCbkDataA = NULL);
110 
111   // Open a PSOutputDev that will write to a generic stream.
112   // pages has to be sorted in increasing order
113   PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA,
114 	      char *psTitleA,
115 	      PDFDoc *docA,
116 	      const std::vector<int> &pages, PSOutMode modeA,
117 	      int paperWidthA = -1, int paperHeightA = -1,
118               GBool noCrop = gFalse,
119 	      GBool duplexA = gTrue,
120 	      int imgLLXA = 0, int imgLLYA = 0,
121 	      int imgURXA = 0, int imgURYA = 0,
122 	      GBool forceRasterizeA = gFalse,
123 	      GBool manualCtrlA = gFalse,
124 	      PSOutCustomCodeCbk customCodeCbkA = NULL,
125 	      void *customCodeCbkDataA = NULL);
126 
127   // Destructor -- writes the trailer and closes the file.
128   virtual ~PSOutputDev();
129 
130   // Check if file was successfully created.
isOk()131   virtual GBool isOk() { return ok; }
132 
133   //---- get info about output device
134 
135   // Does this device use upside-down coordinates?
136   // (Upside-down means (0,0) is the top left corner of the page.)
upsideDown()137   virtual GBool upsideDown() { return gFalse; }
138 
139   // Does this device use drawChar() or drawString()?
useDrawChar()140   virtual GBool useDrawChar() { return gFalse; }
141 
142   // Does this device use tilingPatternFill()?  If this returns false,
143   // tiling pattern fills will be reduced to a series of other drawing
144   // operations.
useTilingPatternFill()145   virtual GBool useTilingPatternFill() { return gTrue; }
146 
147   // Does this device use functionShadedFill(), axialShadedFill(), and
148   // radialShadedFill()?  If this returns false, these shaded fills
149   // will be reduced to a series of other drawing operations.
useShadedFills(int type)150   virtual GBool useShadedFills(int type)
151     { return type < 4 && level >= psLevel2; }
152 
153   // Does this device use drawForm()?  If this returns false,
154   // form-type XObjects will be interpreted (i.e., unrolled).
useDrawForm()155   virtual GBool useDrawForm() { return preloadImagesForms; }
156 
157   // Does this device use beginType3Char/endType3Char?  Otherwise,
158   // text in Type 3 fonts will be drawn with drawChar/drawString.
interpretType3Chars()159   virtual GBool interpretType3Chars() { return gFalse; }
160 
needClipToCropBox()161   virtual GBool needClipToCropBox() { return mode == psModeEPS; }
162 
163   //----- header/trailer (used only if manualCtrl is true)
164 
165   // Write the document-level header.
166   void writeHeader(const std::vector<int> &pages,
167 		   PDFRectangle *mediaBox, PDFRectangle *cropBox,
168 		   int pageRotate, char *pstitle);
169 
170   // Write the Xpdf procset.
171   void writeXpdfProcset();
172 
173   // Write the trailer for the current page.
174   void writePageTrailer();
175 
176   // Write the document trailer.
177   void writeTrailer();
178 
179   //----- initialization and control
180 
181   // Check to see if a page slice should be displayed.  If this
182   // returns false, the page display is aborted.  Typically, an
183   // OutputDev will use some alternate means to display the page
184   // before returning false.
185   virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
186 			       int rotate, GBool useMediaBox, GBool crop,
187 			       int sliceX, int sliceY, int sliceW, int sliceH,
188 			       GBool printing,
189 			       GBool (*abortCheckCbk)(void *data) = NULL,
190 			       void *abortCheckCbkData = NULL,
191 			       GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL,
192 			       void *annotDisplayDecideCbkData = NULL);
193 
194   // Start a page.
195   virtual void startPage(int pageNum, GfxState *state, XRef *xref);
196 
197   // End a page.
198   virtual void endPage();
199 
200   //----- save/restore graphics state
201   virtual void saveState(GfxState *state);
202   virtual void restoreState(GfxState *state);
203 
204   //----- update graphics state
205   virtual void updateCTM(GfxState *state, double m11, double m12,
206 			 double m21, double m22, double m31, double m32);
207   virtual void updateLineDash(GfxState *state);
208   virtual void updateFlatness(GfxState *state);
209   virtual void updateLineJoin(GfxState *state);
210   virtual void updateLineCap(GfxState *state);
211   virtual void updateMiterLimit(GfxState *state);
212   virtual void updateLineWidth(GfxState *state);
213   virtual void updateFillColorSpace(GfxState *state);
214   virtual void updateStrokeColorSpace(GfxState *state);
215   virtual void updateFillColor(GfxState *state);
216   virtual void updateStrokeColor(GfxState *state);
217   virtual void updateFillOverprint(GfxState *state);
218   virtual void updateStrokeOverprint(GfxState *state);
219   virtual void updateOverprintMode(GfxState *state);
220   virtual void updateTransfer(GfxState *state);
221 
222   //----- update text state
223   virtual void updateFont(GfxState *state);
224   virtual void updateTextMat(GfxState *state);
225   virtual void updateCharSpace(GfxState *state);
226   virtual void updateRender(GfxState *state);
227   virtual void updateRise(GfxState *state);
228   virtual void updateWordSpace(GfxState *state);
229   virtual void updateHorizScaling(GfxState *state);
230   virtual void updateTextPos(GfxState *state);
231   virtual void updateTextShift(GfxState *state, double shift);
232   virtual void saveTextPos(GfxState *state);
233   virtual void restoreTextPos(GfxState *state);
234 
235   //----- path painting
236   virtual void stroke(GfxState *state);
237   virtual void fill(GfxState *state);
238   virtual void eoFill(GfxState *state);
239   virtual GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
240 				  double *pmat, int paintType, int tilingType, Dict *resDict,
241 				  double *mat, double *bbox,
242 				  int x0, int y0, int x1, int y1,
243 				  double xStep, double yStep);
244   virtual GBool functionShadedFill(GfxState *state,
245 				   GfxFunctionShading *shading);
246   virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading, double /*tMin*/, double /*tMax*/);
247   virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading, double /*sMin*/, double /*sMax*/);
248 
249   //----- path clipping
250   virtual void clip(GfxState *state);
251   virtual void eoClip(GfxState *state);
252   virtual void clipToStrokePath(GfxState *state);
253 
254   //----- text drawing
255   virtual void drawString(GfxState *state, GooString *s);
256   virtual void beginTextObject(GfxState *state);
257   virtual void endTextObject(GfxState *state);
258 
259   //----- image drawing
260   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
261 			     int width, int height, GBool invert,
262 			     GBool interpolate, GBool inlineImg);
263   virtual void setSoftMaskFromImageMask(GfxState *state,
264 					Object *ref, Stream *str,
265 					int width, int height, GBool invert,
266 					GBool inlineImg, double *baseMatrix);
267   virtual void unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix);
268   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
269 			 int width, int height, GfxImageColorMap *colorMap,
270 			 GBool interpolate, int *maskColors, GBool inlineImg);
271   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
272 			       int width, int height,
273 			       GfxImageColorMap *colorMap,
274 			       GBool interpolate,
275 			       Stream *maskStr, int maskWidth, int maskHeight,
276 			       GBool maskInvert, GBool maskInterpolate);
277 
278 #if OPI_SUPPORT
279   //----- OPI functions
280   virtual void opiBegin(GfxState *state, Dict *opiDict);
281   virtual void opiEnd(GfxState *state, Dict *opiDict);
282 #endif
283 
284   //----- Type 3 font operators
285   virtual void type3D0(GfxState *state, double wx, double wy);
286   virtual void type3D1(GfxState *state, double wx, double wy,
287 		       double llx, double lly, double urx, double ury);
288 
289   //----- form XObjects
290   virtual void drawForm(Ref ref);
291 
292   //----- PostScript XObjects
293   virtual void psXObject(Stream *psStream, Stream *level1Stream);
294 
295   //----- miscellaneous
setOffset(double x,double y)296   void setOffset(double x, double y)
297     { tx0 = x; ty0 = y; }
setScale(double x,double y)298   void setScale(double x, double y)
299     { xScale0 = x; yScale0 = y; }
setRotate(int rotateA)300   void setRotate(int rotateA)
301     { rotate0 = rotateA; }
setClip(double llx,double lly,double urx,double ury)302   void setClip(double llx, double lly, double urx, double ury)
303     { clipLLX0 = llx; clipLLY0 = lly; clipURX0 = urx; clipURY0 = ury; }
setUnderlayCbk(void (* cbk)(PSOutputDev * psOut,void * data),void * data)304   void setUnderlayCbk(void (*cbk)(PSOutputDev *psOut, void *data),
305 		      void *data)
306     { underlayCbk = cbk; underlayCbkData = data; }
setOverlayCbk(void (* cbk)(PSOutputDev * psOut,void * data),void * data)307   void setOverlayCbk(void (*cbk)(PSOutputDev *psOut, void *data),
308 		     void *data)
309     { overlayCbk = cbk; overlayCbkData = data; }
setDisplayText(GBool display)310   void setDisplayText(GBool display) { displayText = display; }
311 
setRasterAntialias(GBool a)312   void setRasterAntialias(GBool a) { rasterAntialias = a; }
setRasterResolution(double r)313   void setRasterResolution(double r) { rasterResolution = r; }
setRasterMono(GBool b)314   void setRasterMono(GBool b) { rasterMono = b; }
setUncompressPreloadedImages(GBool b)315   void setUncompressPreloadedImages(GBool b) { uncompressPreloadedImages = b; }
316 
getEmbedType1()317   GBool getEmbedType1() const { return embedType1; }
getEmbedTrueType()318   GBool getEmbedTrueType() const { return embedTrueType; }
getEmbedCIDPostScript()319   GBool getEmbedCIDPostScript() const { return embedCIDPostScript; }
getEmbedCIDTrueType()320   GBool getEmbedCIDTrueType() const { return embedCIDTrueType; }
getFontPassthrough()321   GBool getFontPassthrough() const { return fontPassthrough; }
getOptimizeColorSpace()322   GBool getOptimizeColorSpace() const { return optimizeColorSpace; }
getEnableLZW()323   GBool getEnableLZW() const { return enableLZW; };
getEnableFlate()324   GBool getEnableFlate() const
325 #if ENABLE_ZLIB
326     { return enableFlate; }
327 #else
328     { return gFalse; }
329 #endif
setEmbedType1(GBool b)330   void setEmbedType1(GBool b) { embedType1 = b; }
setEmbedTrueType(GBool b)331   void setEmbedTrueType(GBool b) { embedTrueType = b; }
setEmbedCIDPostScript(GBool b)332   void setEmbedCIDPostScript(GBool b) { embedCIDPostScript = b; }
setEmbedCIDTrueType(GBool b)333   void setEmbedCIDTrueType(GBool b) { embedCIDTrueType = b; }
setFontPassthrough(GBool b)334   void setFontPassthrough(GBool b) { fontPassthrough = b; }
setOptimizeColorSpace(GBool b)335   void setOptimizeColorSpace(GBool b) { optimizeColorSpace = b; }
setPreloadImagesForms(GBool b)336   void setPreloadImagesForms(GBool b) { preloadImagesForms = b; }
setGenerateOPI(GBool b)337   void setGenerateOPI(GBool b) { generateOPI = b; }
setUseASCIIHex(GBool b)338   void setUseASCIIHex(GBool b) { useASCIIHex = b; }
setUseBinary(GBool b)339   void setUseBinary(GBool b) { useBinary = b; }
setEnableLZW(GBool b)340   void setEnableLZW(GBool b) { enableLZW = b; }
setEnableFlate(GBool b)341   void setEnableFlate(GBool b) { enableFlate = b; }
342 
343 private:
344 
345   void init(PSOutputFunc outputFuncA, void *outputStreamA,
346 	    PSFileType fileTypeA, char *psTitleA, PDFDoc *doc,
347 	    const std::vector<int> &pages, PSOutMode modeA,
348 	    int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
349 	    GBool manualCtrlA, int paperWidthA, int paperHeightA,
350             GBool noCropA, GBool duplexA);
351   void postInit();
352   void setupResources(Dict *resDict);
353   void setupFonts(Dict *resDict);
354   void setupFont(GfxFont *font, Dict *parentResDict);
355   void setupEmbeddedType1Font(Ref *id, GooString *psName);
356   void setupExternalType1Font(GooString *fileName, GooString *psName);
357   void setupEmbeddedType1CFont(GfxFont *font, Ref *id, GooString *psName);
358   void setupEmbeddedOpenTypeT1CFont(GfxFont *font, Ref *id, GooString *psName);
359   void setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id, GooString *psName);
360   void setupExternalTrueTypeFont(GfxFont *font, GooString *fileName,
361 				 GooString *psName);
362   void setupEmbeddedCIDType0Font(GfxFont *font, Ref *id, GooString *psName);
363   void setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id, GooString *psName,
364 				    GBool needVerticalMetrics);
365   void setupExternalCIDTrueTypeFont(GfxFont *font,
366 				    GooString *fileName,
367 				    GooString *psName,
368 				    GBool needVerticalMetrics);
369   void setupEmbeddedOpenTypeCFFFont(GfxFont *font, Ref *id, GooString *psName);
370   void setupType3Font(GfxFont *font, GooString *psName, Dict *parentResDict);
371   GooString *makePSFontName(GfxFont *font, Ref *id);
372   void setupImages(Dict *resDict);
373   void setupImage(Ref id, Stream *str, GBool mask);
374   void setupForms(Dict *resDict);
375   void setupForm(Ref id, Object *strObj);
376   void addProcessColor(double c, double m, double y, double k);
377   void addCustomColor(GfxSeparationColorSpace *sepCS);
378   void doPath(GfxPath *path);
379   void maskToClippingPath(Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert);
380   void doImageL1(Object *ref, GfxImageColorMap *colorMap,
381 		 GBool invert, GBool inlineImg,
382 		 Stream *str, int width, int height, int len,
383 		 int *maskColors, Stream *maskStr,
384 		 int maskWidth, int maskHeight, GBool maskInvert);
385   void doImageL1Sep(Object *ref, GfxImageColorMap *colorMap,
386 		    GBool invert, GBool inlineImg,
387 		    Stream *str, int width, int height, int len,
388 		    int *maskColors, Stream *maskStr,
389 		    int maskWidth, int maskHeight, GBool maskInvert);
390   void doImageL2(Object *ref, GfxImageColorMap *colorMap,
391 		 GBool invert, GBool inlineImg,
392 		 Stream *str, int width, int height, int len,
393 		 int *maskColors, Stream *maskStr,
394 		 int maskWidth, int maskHeight, GBool maskInvert);
395   void doImageL3(Object *ref, GfxImageColorMap *colorMap,
396 		 GBool invert, GBool inlineImg,
397 		 Stream *str, int width, int height, int len,
398 		 int *maskColors, Stream *maskStr,
399 		 int maskWidth, int maskHeight, GBool maskInvert);
400   void dumpColorSpaceL2(GfxColorSpace *colorSpace,
401 			GBool genXform, GBool updateColors,
402 			GBool map01);
403   GBool tilingPatternFillL1(GfxState *state, Catalog *cat, Object *str,
404 			    double *pmat, int paintType, int tilingType, Dict *resDict,
405 			    double *mat, double *bbox,
406 			    int x0, int y0, int x1, int y1,
407 			    double xStep, double yStep);
408   GBool tilingPatternFillL2(GfxState *state, Catalog *cat, Object *str,
409 			    double *pmat, int paintType, int tilingType, Dict *resDict,
410 			    double *mat, double *bbox,
411 			    int x0, int y0, int x1, int y1,
412 			    double xStep, double yStep);
413 
414 #if OPI_SUPPORT
415   void opiBegin20(GfxState *state, Dict *dict);
416   void opiBegin13(GfxState *state, Dict *dict);
417   void opiTransform(GfxState *state, double x0, double y0,
418 		    double *x1, double *y1);
419 #endif
420   void cvtFunction(Function *func, GBool invertPSFunction = gFalse);
421   GooString *filterPSName(GooString *name);
422 
423   // Write the document-level setup.
424   void writeDocSetup(PDFDoc *doc, Catalog *catalog, const std::vector<int> &pages, GBool duplexA);
425 
426   void writePSChar(char c);
427   void writePS(const char *s);
428   void writePSBuf(const char *s, int len);
429   void writePSFmt(const char *fmt, ...);
430   void writePSString(GooString *s);
431   void writePSName(const char *s);
432   GooString *filterPSLabel(GooString *label, GBool *needParens=0);
433   void writePSTextLine(GooString *s);
434 
435   PSLevel level;		// PostScript level (1, 2, separation)
436   PSOutMode mode;		// PostScript mode (PS, EPS, form)
437   int paperWidth;		// width of paper, in pts
438   int paperHeight;		// height of paper, in pts
439   GBool paperMatch;		// true if paper size is set to match each page
440   int prevWidth;		// width of previous page
441                                 // (only psModePSOrigPageSizes output mode)
442   int prevHeight;		// height of previous page
443                                 // (only psModePSOrigPageSizes output mode)
444   int imgLLX, imgLLY,		// imageable area, in pts
445       imgURX, imgURY;
446   GBool noCrop;
447   GBool duplex;
448   std::vector<int> pages;
449   char *psTitle;
450   GBool postInitDone;		// true if postInit() was called
451 
452   PSOutputFunc outputFunc;
453   void *outputStream;
454   PSFileType fileType;		// file / pipe / stdout
455   GBool manualCtrl;
456   int seqPage;			// current sequential page number
457   void (*underlayCbk)(PSOutputDev *psOut, void *data);
458   void *underlayCbkData;
459   void (*overlayCbk)(PSOutputDev *psOut, void *data);
460   void *overlayCbkData;
461   GooString *(*customCodeCbk)(PSOutputDev *psOut,
462 			    PSOutCustomCodeLocation loc, int n,
463 			    void *data);
464   void *customCodeCbkData;
465 
466   PDFDoc *doc;
467   XRef *xref;			// the xref table for this PDF file
468 
469   Ref *fontIDs;			// list of object IDs of all used fonts
470   int fontIDLen;		// number of entries in fontIDs array
471   int fontIDSize;		// size of fontIDs array
472   std::set<int> resourceIDs;	// list of object IDs of objects containing Resources we've already set up
473   GooHash *fontNames;		// all used font names
474   PST1FontName *t1FontNames;	// font names for Type 1/1C fonts
475   int t1FontNameLen;		// number of entries in t1FontNames array
476   int t1FontNameSize;		// size of t1FontNames array
477   PSFont8Info *font8Info;	// info for 8-bit fonts
478   int font8InfoLen;		// number of entries in font8Info array
479   int font8InfoSize;		// size of font8Info array
480   PSFont16Enc *font16Enc;	// encodings for substitute 16-bit fonts
481   int font16EncLen;		// number of entries in font16Enc array
482   int font16EncSize;		// size of font16Enc array
483   Ref *imgIDs;			// list of image IDs for in-memory images
484   int imgIDLen;			// number of entries in imgIDs array
485   int imgIDSize;		// size of imgIDs array
486   Ref *formIDs;			// list of IDs for predefined forms
487   int formIDLen;		// number of entries in formIDs array
488   int formIDSize;		// size of formIDs array
489   int numSaves;			// current number of gsaves
490   int numTilingPatterns;	// current number of nested tiling patterns
491   int nextFunc;			// next unique number to use for a function
492 
493   GooList *paperSizes;		// list of used paper sizes, if paperMatch
494 				//   is true [PSOutPaperSize]
495   std::map<int,int> pagePaperSize; // page num to paperSize entry mapping
496   double tx0, ty0;		// global translation
497   double xScale0, yScale0;	// global scaling
498   int rotate0;			// rotation angle (0, 90, 180, 270)
499   double clipLLX0, clipLLY0,
500          clipURX0, clipURY0;
501   double tx, ty;		// global translation for current page
502   double xScale, yScale;	// global scaling for current page
503   int rotate;			// rotation angle for current page
504   double epsX1, epsY1,		// EPS bounding box (unrotated)
505          epsX2, epsY2;
506 
507   GooString *embFontList;		// resource comments for embedded fonts
508 
509   int processColors;		// used process colors
510   PSOutCustomColor		// used custom colors
511     *customColors;
512 
513   GBool haveTextClip;		// set if text has been drawn with a
514 				//   clipping render mode
515 
516   GBool inType3Char;		// inside a Type 3 CharProc
517   GBool inUncoloredPattern;     // inside a uncolored pattern (PaintType = 2)
518   GooString *t3String;		// Type 3 content string
519   double t3WX, t3WY,		// Type 3 character parameters
520          t3LLX, t3LLY, t3URX, t3URY;
521   GBool t3FillColorOnly;	// operators should only use the fill color
522   GBool t3Cacheable;		// cleared if char is not cacheable
523   GBool t3NeedsRestore;		// set if a 'q' operator was issued
524   GBool forceRasterize;		// forces the page to be rasterized into a image before printing
525   GBool displayText;		// displayText
526   GBool rasterAntialias;	// antialias on rasterize
527   GBool uncompressPreloadedImages;
528   double rasterResolution;	// PostScript rasterization resolution (dpi)
529   GBool rasterMono;		// true to do PostScript rasterization
530 				//   in monochrome (gray); false to do it
531 				//   in color (RGB/CMYK)
532   GBool embedType1;		// embed Type 1 fonts?
533   GBool embedTrueType;		// embed TrueType fonts?
534   GBool embedCIDPostScript;	// embed CID PostScript fonts?
535   GBool embedCIDTrueType;	// embed CID TrueType fonts?
536   GBool fontPassthrough;	// pass all fonts through as-is?
537   GBool optimizeColorSpace;	// false to keep gray RGB images in their original color space
538 				// true to optimize gray images to DeviceGray color space
539   GBool preloadImagesForms;	// preload PostScript images and forms into
540 				//   memory
541   GBool generateOPI;		// generate PostScript OPI comments?
542   GBool useASCIIHex;		// use ASCIIHex instead of ASCII85?
543   GBool useBinary;		// use binary instead of hex
544   GBool enableLZW;		// enable LZW compression
545   GBool enableFlate;		// enable Flate compression
546 
547 #if OPI_SUPPORT
548   int opi13Nest;		// nesting level of OPI 1.3 objects
549   int opi20Nest;		// nesting level of OPI 2.0 objects
550 #endif
551 
552   GBool ok;			// set up ok?
553 
554   friend class WinPDFPrinter;
555 };
556 
557 #endif
558