pdf-parser.h revision 53b874ce295bb32538ebaee9c7f550b33402a5fd
/** \file
* PDF parsing module using libpoppler's facilities
*
* Derived from Gfx.h
*
* Copyright 1996-2003 Glyph & Cog, LLC
*
*/
#ifndef PDF_PARSER_H
#define PDF_PARSER_H
#ifdef HAVE_POPPLER
#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif
}
}
}
#include "Object.h"
struct GfxPatch;
struct GfxColor;
//------------------------------------------------------------------------
#ifndef GFX_H
enum GfxClipType {
};
enum TchkType {
tchkBool, // boolean
tchkInt, // integer
tchkNum, // number (integer or real)
tchkString, // string
tchkName, // name
tchkArray, // array
tchkProps, // properties (dictionary or name)
tchkNone // used to avoid empty initializer lists
};
#endif /* GFX_H */
#define maxOperatorArgs 33
struct PdfOperator {
char name[4];
int numArgs;
};
struct OpHistoryEntry {
const char *name; // operator's name
unsigned depth; // total number of entries descending from this
};
//------------------------------------------------------------------------
// ClipHistoryEntry
//------------------------------------------------------------------------
~ClipHistoryEntry();
// Manipulate clip path stack
ClipHistoryEntry *save();
};
//------------------------------------------------------------------------
// PdfParser
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// constants
//------------------------------------------------------------------------
#define pdfFunctionShading 1
#define pdfAxialShading 2
#define pdfRadialShading 3
#define pdfGouraudTriangleShading 4
#define pdfPatchMeshShading 5
#define pdfNumShadingTypes 5
// Constructor for regular output.
// Constructor for a sub-page object.
~PdfParser();
// Interpret a stream or array of streams.
// Save graphics state.
void saveState();
// Restore graphics state.
void restoreState();
// Get the current graphics state object.
// Set the precision of approximation for specific shading fills.
int ignoreUndef; // current BX/EX nesting level
int formDepth;
// max deltas allowed in any color component
// for the approximation of shading fills
void setDefaultApproximationPrecision(); // init color deltas
void pushOperator(const char *name);
const char *getPreviousOperator(unsigned int look_back=1); // returns the nth previous operator's name
int getPos();
// graphics state operators
// color operators
// path segment operators
// path painting operators
void doPatternStrokeFallback();
void doEndPath();
// path clipping operators
// text object operators
// text state operators
// text positioning operators
// text string operators
void doShowText(GooString *s);
// XObject operators
// in-line image operators
// type 3 font operators
// compatibility operators
// marked content operators
void popResources();
};
#endif /* HAVE_POPPLER */
#endif /* PDF_PARSER_H */