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>2004-05-16 22:45:42 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2004-05-16 22:45:42 (GMT)
commitad63666daeeda50acc7630132d61fe044634fddd (patch)
tree487b52b30f8a563cbb2e16c6fd2527a6eeb5990f /pdf/xpdf/PSOutputDev.h
parentd57c02ebc09bfd1a0cac44140ec7a80dbe43877e (diff)
Imported Xpdf 2.03 and fixed build.
* ANNOUNCE: * CHANGES: * README: * aconf2.h: * configure.in: * dj_make.bat: * doc/pdffonts.1: * doc/pdffonts.cat: * doc/pdffonts.hlp: * doc/pdfimages.1: * doc/pdfimages.cat: * doc/pdfimages.hlp: * doc/pdfinfo.1: * doc/pdfinfo.cat: * doc/pdfinfo.hlp: * doc/pdftopbm.1: * doc/pdftopbm.cat: * doc/pdftopbm.hlp: * doc/pdftops.1: * doc/pdftops.cat: * doc/pdftops.hlp: * doc/pdftotext.1: * doc/pdftotext.cat: * doc/pdftotext.hlp: * doc/xpdf.1: * doc/xpdf.cat: * doc/xpdf.hlp: * doc/xpdfrc.5: * doc/xpdfrc.cat: * doc/xpdfrc.hlp: * goo/gfile.cc: * ms_make.bat: * vms_make.com: * xpdf/Annot.cc: * xpdf/Array.cc: * xpdf/BuiltinFontTables.cc: * xpdf/CMap.cc: * xpdf/CMap.h: * xpdf/Catalog.cc: * xpdf/CharCodeToUnicode.cc: * xpdf/CharCodeToUnicode.h: * xpdf/Decrypt.cc: * xpdf/Dict.cc: * xpdf/ErrorCodes.h: * xpdf/FTFont.cc: * xpdf/FTFont.h: * xpdf/FontFile.cc: * xpdf/FontFile.h: * xpdf/Function.cc: * xpdf/Gfx.cc: * xpdf/Gfx.h: * xpdf/GfxFont.cc: * xpdf/GfxFont.h: * xpdf/GfxState.cc: * xpdf/GfxState.h: * xpdf/GlobalParams.cc: * xpdf/GlobalParams.h: * xpdf/JBIG2Stream.cc: * xpdf/Link.cc: * xpdf/Link.h: * xpdf/Makefile.am: * xpdf/OutputDev.h: * xpdf/PDFDoc.cc: * xpdf/PDFDoc.h: * xpdf/PSOutputDev.cc: * xpdf/PSOutputDev.h: * xpdf/Page.cc: * xpdf/Page.h: * xpdf/Parser.cc: * xpdf/Stream.cc: * xpdf/Stream.h: * xpdf/TTFont.cc: * xpdf/TTFont.h: * xpdf/TextOutputDev.cc: * xpdf/TextOutputDev.h: * xpdf/UnicodeMap.cc: * xpdf/UnicodeMap.h: * xpdf/UnicodeTypeTable.cc: * xpdf/UnicodeTypeTable.h: * xpdf/XOutputDev.cc: * xpdf/XOutputDev.h: * xpdf/XPDFApp.cc: * xpdf/XPDFCore.cc: * xpdf/XPDFCore.h: * xpdf/XPDFViewer.cc: * xpdf/XPDFViewer.h: * xpdf/XRef.cc: * xpdf/about-text.h: * xpdf/config.h: * xpdf/gpdf-control.cc: * xpdf/gpdf-link-canvas-item.cc: * xpdf/gpdf-links-canvas-layer.cc: * xpdf/pdffonts.cc: * xpdf/pdfimages.cc: * xpdf/pdfinfo.cc: * xpdf/pdftopbm.cc: * xpdf/pdftops.cc: * xpdf/pdftotext.cc: * xpdf/tests/test-links.cc: * xpdf/vms_make.com: * xpdf/xpdf.cc: Imported Xpdf 2.03 and fixed build.
Diffstat (limited to 'pdf/xpdf/PSOutputDev.h')
-rw-r--r--pdf/xpdf/PSOutputDev.h70
1 files changed, 59 insertions, 11 deletions
diff --git a/pdf/xpdf/PSOutputDev.h b/pdf/xpdf/PSOutputDev.h
index f7896cc..06130fb 100644
--- a/pdf/xpdf/PSOutputDev.h
+++ b/pdf/xpdf/PSOutputDev.h
@@ -25,6 +25,7 @@ class GfxPath;
class GfxFont;
class GfxColorSpace;
class GfxSeparationColorSpace;
+class PDFRectangle;
struct PSFont16Enc;
class PSOutCustomColor;
@@ -52,12 +53,16 @@ public:
// Open a PostScript output file, and write the prolog.
PSOutputDev(char *fileName, XRef *xrefA, Catalog *catalog,
- int firstPage, int lastPage, PSOutMode modeA);
+ int firstPage, int lastPage, PSOutMode modeA,
+ int paperWidthA = 0, int paperHeightA = 0,
+ GBool manualCtrlA = gFalse);
// Open a PSOutputDev that will write to a generic stream.
PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA,
XRef *xrefA, Catalog *catalog,
- int firstPage, int lastPage, PSOutMode modeA);
+ int firstPage, int lastPage, PSOutMode modeA,
+ int paperWidthA = 0, int paperHeightA = 0,
+ GBool manualCtrlA = gFalse);
// Destructor -- writes the trailer and closes the file.
virtual ~PSOutputDev();
@@ -78,6 +83,26 @@ public:
// text in Type 3 fonts will be drawn with drawChar/drawString.
virtual GBool interpretType3Chars() { return gFalse; }
+ //----- header/trailer (used only if manualCtrl is true)
+
+ // Write the document-level header.
+ void writeHeader(int firstPage, int lastPage, PDFRectangle *box);
+
+ // Write the Xpdf procset.
+ void writeXpdfProcset();
+
+ // Write the document-level setup.
+ void writeDocSetup(Catalog *catalog, int firstPage, int lastPage);
+
+ // Write the setup for the current page.
+ void writePageSetup();
+
+ // Write the trailer for the current page.
+ void writePageTrailer();
+
+ // Write the document trailer.
+ void writeTrailer();
+
//----- initialization and control
// Start a page.
@@ -124,6 +149,7 @@ public:
//----- text drawing
virtual void drawString(GfxState *state, GString *s);
+ virtual void endTextObject(GfxState *state);
//----- image drawing
virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
@@ -147,23 +173,32 @@ public:
//----- PostScript XObjects
virtual void psXObject(Stream *psStream, Stream *level1Stream);
+ //----- miscellaneous
+ void setUnderlayCbk(void (*cbk)(PSOutputDev *psOut, void *data),
+ void *data)
+ { underlayCbk = cbk; underlayCbkData = data; }
+ void setOverlayCbk(void (*cbk)(PSOutputDev *psOut, void *data),
+ void *data)
+ { overlayCbk = cbk; overlayCbkData = data; }
private:
void init(PSOutputFunc outputFuncA, void *outputStreamA,
PSFileType fileTypeA, XRef *xrefA, Catalog *catalog,
- int firstPage, int lastPage, PSOutMode modeA);
+ int firstPage, int lastPage, PSOutMode modeA,
+ int paperWidthA, int paperHeightA,
+ GBool manualCtrlA);
void setupResources(Dict *resDict);
void setupFonts(Dict *resDict);
void setupFont(GfxFont *font, Dict *parentResDict);
- void setupEmbeddedType1Font(Ref *id, 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 setupEmbeddedType1Font(Ref *id, GString *psName);
+ void setupExternalType1Font(GString *fileName, GString *psName);
+ void setupEmbeddedType1CFont(GfxFont *font, Ref *id, GString *psName);
+ void setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id, GString *psName);
+ void setupExternalTrueTypeFont(GfxFont *font, GString *psName);
+ void setupEmbeddedCIDType0Font(GfxFont *font, Ref *id, GString *psName);
+ void setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id, GString *psName);
+ void setupType3Font(GfxFont *font, GString *psName, Dict *parentResDict);
void setupImages(Dict *resDict);
void setupImage(Ref id, Stream *str);
void addProcessColor(double c, double m, double y, double k);
@@ -201,7 +236,12 @@ private:
PSOutputFunc outputFunc;
void *outputStream;
PSFileType fileType; // file / pipe / stdout
+ GBool manualCtrl;
int seqPage; // current sequential page number
+ void (*underlayCbk)(PSOutputDev *psOut, void *data);
+ void *underlayCbkData;
+ void (*overlayCbk)(PSOutputDev *psOut, void *data);
+ void *overlayCbkData;
XRef *xref; // the xref table for this PDF file
@@ -214,11 +254,14 @@ 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
+ int nextTrueTypeNum; // next unique number to append to a TrueType
+ // font name
PSFont16Enc *font16Enc; // encodings for substitute 16-bit fonts
int font16EncLen; // number of entries in font16Enc array
int font16EncSize; // size of font16Enc array
GList *xobjStack; // stack of XObject dicts currently being
// processed
+ int numSaves; // current number of gsaves
double tx, ty; // global translation
double xScale, yScale; // global scaling
@@ -230,6 +273,9 @@ private:
PSOutCustomColor // used custom colors
*customColors;
+ GBool haveTextClip; // set if text has been drawn with a
+ // clipping render mode
+
GBool inType3Char; // inside a Type 3 CharProc
GString *t3String; // Type 3 content string
double t3WX, t3WY, // Type 3 character parameters
@@ -243,6 +289,8 @@ private:
GBool ok; // set up ok?
+
+ friend class WinPDFPrinter;
};
#endif