912 lines
26 KiB
JavaScript
912 lines
26 KiB
JavaScript
// All the possible operations for an operator list.
|
|
const OPS = {
|
|
dependency: 1,
|
|
setLineWidth: 2,
|
|
setLineCap: 3,
|
|
setLineJoin: 4,
|
|
setMiterLimit: 5,
|
|
setDash: 6,
|
|
setRenderingIntent: 7,
|
|
setFlatness: 8,
|
|
setGState: 9,
|
|
save: 10,
|
|
restore: 11,
|
|
transform: 12,
|
|
moveTo: 13,
|
|
lineTo: 14,
|
|
curveTo: 15,
|
|
curveTo2: 16,
|
|
curveTo3: 17,
|
|
closePath: 18,
|
|
rectangle: 19,
|
|
stroke: 20,
|
|
closeStroke: 21,
|
|
fill: 22,
|
|
eoFill: 23,
|
|
fillStroke: 24,
|
|
eoFillStroke: 25,
|
|
closeFillStroke: 26,
|
|
closeEOFillStroke: 27,
|
|
endPath: 28,
|
|
clip: 29,
|
|
eoClip: 30,
|
|
beginText: 31,
|
|
endText: 32,
|
|
setCharSpacing: 33,
|
|
setWordSpacing: 34,
|
|
setHScale: 35,
|
|
setLeading: 36,
|
|
setFont: 37,
|
|
setTextRenderingMode: 38,
|
|
setTextRise: 39,
|
|
moveText: 40,
|
|
setLeadingMoveText: 41,
|
|
setTextMatrix: 42,
|
|
nextLine: 43,
|
|
showText: 44,
|
|
showSpacedText: 45,
|
|
nextLineShowText: 46,
|
|
nextLineSetSpacingShowText: 47,
|
|
setCharWidth: 48,
|
|
setCharWidthAndBounds: 49,
|
|
setStrokeColorSpace: 50,
|
|
setFillColorSpace: 51,
|
|
setStrokeColor: 52,
|
|
setStrokeColorN: 53,
|
|
setFillColor: 54,
|
|
setFillColorN: 55,
|
|
setStrokeGray: 56,
|
|
setFillGray: 57,
|
|
setStrokeRGBColor: 58,
|
|
setFillRGBColor: 59,
|
|
setStrokeCMYKColor: 60,
|
|
setFillCMYKColor: 61,
|
|
shadingFill: 62,
|
|
beginInlineImage: 63,
|
|
beginImageData: 64,
|
|
endInlineImage: 65,
|
|
paintXObject: 66,
|
|
markPoint: 67,
|
|
markPointProps: 68,
|
|
beginMarkedContent: 69,
|
|
beginMarkedContentProps: 70,
|
|
endMarkedContent: 71,
|
|
beginCompat: 72,
|
|
endCompat: 73,
|
|
paintFormXObjectBegin: 74,
|
|
paintFormXObjectEnd: 75,
|
|
beginGroup: 76,
|
|
endGroup: 77,
|
|
// beginAnnotations: 78,
|
|
// endAnnotations: 79,
|
|
beginAnnotation: 80,
|
|
endAnnotation: 81,
|
|
// paintJpegXObject: 82,
|
|
paintImageMaskXObject: 83,
|
|
paintImageMaskXObjectGroup: 84,
|
|
paintImageXObject: 85,
|
|
paintInlineImageXObject: 86,
|
|
paintInlineImageXObjectGroup: 87,
|
|
paintImageXObjectRepeat: 88,
|
|
paintImageMaskXObjectRepeat: 89,
|
|
paintSolidColorImageMask: 90,
|
|
constructPath: 91,
|
|
setStrokeTransparent: 92,
|
|
setFillTransparent: 93
|
|
};
|
|
|
|
|
|
const opMap = {
|
|
// Graphic state
|
|
w: { id: OPS.setLineWidth, numArgs: 1, variableArgs: false },
|
|
J: { id: OPS.setLineCap, numArgs: 1, variableArgs: false },
|
|
j: { id: OPS.setLineJoin, numArgs: 1, variableArgs: false },
|
|
M: { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false },
|
|
d: { id: OPS.setDash, numArgs: 2, variableArgs: false },
|
|
ri: { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false },
|
|
i: { id: OPS.setFlatness, numArgs: 1, variableArgs: false },
|
|
gs: { id: OPS.setGState, numArgs: 1, variableArgs: false },
|
|
q: { id: OPS.save, numArgs: 0, variableArgs: false },
|
|
Q: { id: OPS.restore, numArgs: 0, variableArgs: false },
|
|
cm: { id: OPS.transform, numArgs: 6, variableArgs: false },
|
|
|
|
// Path
|
|
m: { id: OPS.moveTo, numArgs: 2, variableArgs: false },
|
|
l: { id: OPS.lineTo, numArgs: 2, variableArgs: false },
|
|
c: { id: OPS.curveTo, numArgs: 6, variableArgs: false },
|
|
v: { id: OPS.curveTo2, numArgs: 4, variableArgs: false },
|
|
y: { id: OPS.curveTo3, numArgs: 4, variableArgs: false },
|
|
h: { id: OPS.closePath, numArgs: 0, variableArgs: false },
|
|
re: { id: OPS.rectangle, numArgs: 4, variableArgs: false },
|
|
S: { id: OPS.stroke, numArgs: 0, variableArgs: false },
|
|
s: { id: OPS.closeStroke, numArgs: 0, variableArgs: false },
|
|
f: { id: OPS.fill, numArgs: 0, variableArgs: false },
|
|
F: { id: OPS.fill, numArgs: 0, variableArgs: false },
|
|
'f*': { id: OPS.eoFill, numArgs: 0, variableArgs: false },
|
|
B: { id: OPS.fillStroke, numArgs: 0, variableArgs: false },
|
|
'B*': { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false },
|
|
b: { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false },
|
|
'b*': { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false },
|
|
n: { id: OPS.endPath, numArgs: 0, variableArgs: false },
|
|
|
|
// Clipping
|
|
W: { id: OPS.clip, numArgs: 0, variableArgs: false },
|
|
'W*': { id: OPS.eoClip, numArgs: 0, variableArgs: false },
|
|
|
|
// Text
|
|
BT: { id: OPS.beginText, numArgs: 0, variableArgs: false },
|
|
ET: { id: OPS.endText, numArgs: 0, variableArgs: false },
|
|
Tc: { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false },
|
|
Tw: { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false },
|
|
Tz: { id: OPS.setHScale, numArgs: 1, variableArgs: false },
|
|
TL: { id: OPS.setLeading, numArgs: 1, variableArgs: false },
|
|
Tf: { id: OPS.setFont, numArgs: 2, variableArgs: false },
|
|
Tr: { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false },
|
|
Ts: { id: OPS.setTextRise, numArgs: 1, variableArgs: false },
|
|
Td: { id: OPS.moveText, numArgs: 2, variableArgs: false },
|
|
TD: { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false },
|
|
Tm: { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false },
|
|
'T*': { id: OPS.nextLine, numArgs: 0, variableArgs: false },
|
|
Tj: { id: OPS.showText, numArgs: 1, variableArgs: false },
|
|
TJ: { id: OPS.showSpacedText, numArgs: 1, variableArgs: false },
|
|
'\'': { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false },
|
|
'"': {
|
|
id: OPS.nextLineSetSpacingShowText,
|
|
numArgs: 3,
|
|
variableArgs: false
|
|
},
|
|
|
|
// Type3 fonts
|
|
d0: { id: OPS.setCharWidth, numArgs: 2, variableArgs: false },
|
|
d1: {
|
|
id: OPS.setCharWidthAndBounds,
|
|
numArgs: 6,
|
|
variableArgs: false
|
|
},
|
|
|
|
// Color
|
|
CS: { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false },
|
|
cs: { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false },
|
|
SC: { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true },
|
|
SCN: { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true },
|
|
sc: { id: OPS.setFillColor, numArgs: 4, variableArgs: true },
|
|
scn: { id: OPS.setFillColorN, numArgs: 33, variableArgs: true },
|
|
G: { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false },
|
|
g: { id: OPS.setFillGray, numArgs: 1, variableArgs: false },
|
|
RG: { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false },
|
|
rg: { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false },
|
|
K: { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false },
|
|
k: { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false },
|
|
|
|
// Shading
|
|
sh: { id: OPS.shadingFill, numArgs: 1, variableArgs: false },
|
|
|
|
// Images
|
|
BI: { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false },
|
|
ID: { id: OPS.beginImageData, numArgs: 0, variableArgs: false },
|
|
EI: { id: OPS.endInlineImage, numArgs: 1, variableArgs: false },
|
|
|
|
// XObjects
|
|
Do: { id: OPS.paintXObject, numArgs: 1, variableArgs: false },
|
|
MP: { id: OPS.markPoint, numArgs: 1, variableArgs: false },
|
|
DP: { id: OPS.markPointProps, numArgs: 2, variableArgs: false },
|
|
BMC: { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false },
|
|
BDC: {
|
|
id: OPS.beginMarkedContentProps,
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
EMC: { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false },
|
|
|
|
// Compatibility
|
|
BX: { id: OPS.beginCompat, numArgs: 0, variableArgs: false },
|
|
EX: { id: OPS.endCompat, numArgs: 0, variableArgs: false }
|
|
};
|
|
|
|
const invertedOPS = Object.entries(OPS).reduce((acc, [key, value]) => {
|
|
acc[value] = {
|
|
name: key,
|
|
keyword: Object.entries(opMap).find(([_, op]) => op.id === value)?.[0] || null,
|
|
description: getOperatorDescription(key),
|
|
...(opMap[Object.entries(opMap).find(([_, op]) => op.id === value)?.[0]] || {})
|
|
};
|
|
return acc;
|
|
}, {});
|
|
|
|
function getOperatorDescription(opName) {
|
|
const descriptions = {
|
|
setLineWidth: 'Sets the line width in the graphics state',
|
|
setLineCap: 'Sets the line cap style in the graphics state (0=butt, 1=round, 2=square)',
|
|
setLineJoin: 'Sets the line join style in the graphics state (0=miter, 1=round, 2=bevel)',
|
|
setMiterLimit: 'Sets the miter limit in the graphics state',
|
|
setDash: 'Sets the line dash pattern in the graphics state',
|
|
setRenderingIntent: 'Sets the color rendering intent in the graphics state',
|
|
setFlatness: 'Sets the flatness tolerance in the graphics state',
|
|
setGState: 'Sets the specified parameters in the graphics state',
|
|
save: 'Pushes a copy of the current graphics state onto the graphics state stack',
|
|
restore: 'Restores the graphics state by popping it from the stack',
|
|
transform: 'Modifies the current transformation matrix (CTM)',
|
|
moveTo: 'Begins a new subpath by moving to coordinates (x, y)',
|
|
lineTo: 'Adds a straight line segment to the current path',
|
|
curveTo: 'Adds a Bézier curve segment to the current path using two control points',
|
|
curveTo2: 'Adds a Bézier curve segment to the current path using one control point',
|
|
curveTo3: 'Adds a Bézier curve segment to the current path using one control point',
|
|
closePath: 'Closes the current subpath',
|
|
rectangle: 'Adds a rectangle to the current path',
|
|
stroke: 'Strokes the current path',
|
|
closeStroke: 'Closes and strokes the current path',
|
|
fill: 'Fills the current path using nonzero winding number rule',
|
|
eoFill: 'Fills the current path using even-odd rule',
|
|
fillStroke: 'Fills and strokes the current path using nonzero winding number rule',
|
|
eoFillStroke: 'Fills and strokes the current path using even-odd rule',
|
|
closeFillStroke: 'Closes, fills, and strokes the current path using nonzero winding number rule',
|
|
closeEOFillStroke: 'Closes, fills, and strokes the current path using even-odd rule',
|
|
endPath: 'Ends the current path without filling or stroking',
|
|
clip: 'Sets the current path as the clipping path using nonzero winding number rule',
|
|
eoClip: 'Sets the current path as the clipping path using even-odd rule',
|
|
beginText: 'Begins a text object',
|
|
endText: 'Ends a text object',
|
|
setCharSpacing: 'Sets the character spacing',
|
|
setWordSpacing: 'Sets the word spacing',
|
|
setHScale: 'Sets the horizontal scaling',
|
|
setLeading: 'Sets the text leading',
|
|
setFont: 'Sets the text font and size',
|
|
setTextRenderingMode: 'Sets the text rendering mode',
|
|
setTextRise: 'Sets the text rise',
|
|
moveText: 'Moves to the start of the next line using offset coordinates',
|
|
setLeadingMoveText: 'Sets the text leading and moves to the next line',
|
|
setTextMatrix: 'Sets the text matrix and text line matrix',
|
|
nextLine: 'Moves to the start of the next line',
|
|
showText: 'Shows a text string',
|
|
showSpacedText: 'Shows a text string with individual glyph positioning',
|
|
nextLineShowText: 'Moves to the next line and shows a text string',
|
|
nextLineSetSpacingShowText: 'Sets word and character spacing, moves to next line, and shows text',
|
|
setCharWidth: 'Sets the character width information for Type 3 fonts',
|
|
setCharWidthAndBounds: 'Sets the character width and bounding box for Type 3 fonts',
|
|
setStrokeColorSpace: 'Sets the color space for stroking operations',
|
|
setFillColorSpace: 'Sets the color space for nonstroking operations',
|
|
setStrokeColor: 'Sets the color for stroking operations',
|
|
setStrokeColorN: 'Sets the color for stroking operations (ICCBased and special color spaces)',
|
|
setFillColor: 'Sets the color for nonstroking operations',
|
|
setFillColorN: 'Sets the color for nonstroking operations (ICCBased and special color spaces)',
|
|
setStrokeGray: 'Sets the gray level for stroking operations',
|
|
setFillGray: 'Sets the gray level for nonstroking operations',
|
|
setStrokeRGBColor: 'Sets the RGB color for stroking operations',
|
|
setFillRGBColor: 'Sets the RGB color for nonstroking operations',
|
|
setStrokeCMYKColor: 'Sets the CMYK color for stroking operations',
|
|
setFillCMYKColor: 'Sets the CMYK color for nonstroking operations',
|
|
shadingFill: 'Fills the current path using a shading pattern',
|
|
beginInlineImage: 'Begins an inline image object',
|
|
beginImageData: 'Begins the inline image data',
|
|
endInlineImage: 'Ends an inline image object',
|
|
paintXObject: 'Paints the specified XObject',
|
|
markPoint: 'Marks a point in the content stream',
|
|
markPointProps: 'Marks a point in the content stream with properties',
|
|
beginMarkedContent: 'Begins a marked-content sequence',
|
|
beginMarkedContentProps: 'Begins a marked-content sequence with properties',
|
|
endMarkedContent: 'Ends a marked-content sequence',
|
|
beginCompat: 'Begins a compatibility section',
|
|
endCompat: 'Ends a compatibility section',
|
|
paintFormXObjectBegin: 'Begins painting a form XObject',
|
|
paintFormXObjectEnd: 'Ends painting a form XObject',
|
|
beginGroup: 'Begins a transparency group',
|
|
endGroup: 'Ends a transparency group',
|
|
beginAnnotation: 'Begins an annotation',
|
|
endAnnotation: 'Ends an annotation',
|
|
paintImageMaskXObject: 'Paints an image mask XObject',
|
|
paintImageMaskXObjectGroup: 'Paints an image mask XObject group',
|
|
paintImageXObject: 'Paints an image XObject',
|
|
paintInlineImageXObject: 'Paints an inline image XObject',
|
|
paintInlineImageXObjectGroup: 'Paints an inline image XObject group',
|
|
paintImageXObjectRepeat: 'Paints a repeated image XObject',
|
|
paintImageMaskXObjectRepeat: 'Paints a repeated image mask XObject',
|
|
paintSolidColorImageMask: 'Paints a solid color image mask',
|
|
constructPath: 'Constructs a path from the specified segments',
|
|
setStrokeTransparent: 'Sets the stroke transparency',
|
|
setFillTransparent: 'Sets the fill transparency',
|
|
dependency: 'Marks a resource dependency'
|
|
};
|
|
|
|
return descriptions[opName] || 'No description available';
|
|
}
|
|
|
|
const opLookup = {
|
|
'1': {
|
|
name: 'dependency',
|
|
keyword: "Do",
|
|
description: 'Marks a resource dependency',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'2': {
|
|
name: 'setLineWidth',
|
|
keyword: 'w',
|
|
description: 'Sets the line width in the graphics state',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'3': {
|
|
name: 'setLineCap',
|
|
keyword: 'J',
|
|
description: 'Sets the line cap style in the graphics state (0=butt, 1=round, 2=square)',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'4': {
|
|
name: 'setLineJoin',
|
|
keyword: 'j',
|
|
description: 'Sets the line join style in the graphics state (0=miter, 1=round, 2=bevel)',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'5': {
|
|
name: 'setMiterLimit',
|
|
keyword: 'M',
|
|
description: 'Sets the miter limit in the graphics state',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'6': {
|
|
name: 'setDash',
|
|
keyword: 'd',
|
|
description: 'Sets the line dash pattern in the graphics state',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'7': {
|
|
name: 'setRenderingIntent',
|
|
keyword: 'ri',
|
|
description: 'Sets the color rendering intent in the graphics state',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'8': {
|
|
name: 'setFlatness',
|
|
keyword: 'i',
|
|
description: 'Sets the flatness tolerance in the graphics state',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'9': {
|
|
name: 'setGState',
|
|
keyword: 'gs',
|
|
description: 'Sets the specified parameters in the graphics state',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'10': {
|
|
name: 'save',
|
|
keyword: 'q',
|
|
description: 'Pushes a copy of the current graphics state onto the graphics state stack',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'11': {
|
|
name: 'restore',
|
|
keyword: 'Q',
|
|
description: 'Restores the graphics state by popping it from the stack',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'12': {
|
|
name: 'transform',
|
|
keyword: 'cm',
|
|
description: 'Modifies the current transformation matrix (CTM)',
|
|
numArgs: 6,
|
|
variableArgs: false
|
|
},
|
|
'13': {
|
|
name: 'moveTo',
|
|
keyword: 'm',
|
|
description: 'Begins a new subpath by moving to coordinates (x, y)',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'14': {
|
|
name: 'lineTo',
|
|
keyword: 'l',
|
|
description: 'Adds a straight line segment to the current path',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'15': {
|
|
name: 'curveTo',
|
|
keyword: 'c',
|
|
description: 'Adds a Bézier curve segment to the current path using two control points',
|
|
numArgs: 6,
|
|
variableArgs: false
|
|
},
|
|
'16': {
|
|
name: 'curveTo2',
|
|
keyword: 'v',
|
|
description: 'Adds a Bézier curve segment to the current path using one control point',
|
|
numArgs: 4,
|
|
variableArgs: false
|
|
},
|
|
'17': {
|
|
name: 'curveTo3',
|
|
keyword: 'y',
|
|
description: 'Adds a Bézier curve segment to the current path using one control point',
|
|
numArgs: 4,
|
|
variableArgs: false
|
|
},
|
|
'18': {
|
|
name: 'closePath',
|
|
keyword: 'h',
|
|
description: 'Closes the current subpath',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'19': {
|
|
name: 'rectangle',
|
|
keyword: 're',
|
|
description: 'Adds a rectangle to the current path',
|
|
numArgs: 4,
|
|
variableArgs: false
|
|
},
|
|
'20': {
|
|
name: 'stroke',
|
|
keyword: 'S',
|
|
description: 'Strokes the current path',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'21': {
|
|
name: 'closeStroke',
|
|
keyword: 's',
|
|
description: 'Closes and strokes the current path',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'22': {
|
|
name: 'fill',
|
|
keyword: 'f',
|
|
description: 'Fills the current path using nonzero winding number rule',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'23': {
|
|
name: 'eoFill',
|
|
keyword: 'f*',
|
|
description: 'Fills the current path using even-odd rule',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'24': {
|
|
name: 'fillStroke',
|
|
keyword: 'B',
|
|
description: 'Fills and strokes the current path using nonzero winding number rule',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'25': {
|
|
name: 'eoFillStroke',
|
|
keyword: 'B*',
|
|
description: 'Fills and strokes the current path using even-odd rule',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'26': {
|
|
name: 'closeFillStroke',
|
|
keyword: 'b',
|
|
description: 'Closes, fills, and strokes the current path using nonzero winding number rule',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'27': {
|
|
name: 'closeEOFillStroke',
|
|
keyword: 'b*',
|
|
description: 'Closes, fills, and strokes the current path using even-odd rule',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'28': {
|
|
name: 'endPath',
|
|
keyword: 'n',
|
|
description: 'Ends the current path without filling or stroking',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'29': {
|
|
name: 'clip',
|
|
keyword: 'W',
|
|
description: 'Sets the current path as the clipping path using nonzero winding number rule',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'30': {
|
|
name: 'eoClip',
|
|
keyword: 'W*',
|
|
description: 'Sets the current path as the clipping path using even-odd rule',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'31': {
|
|
name: 'beginText',
|
|
keyword: 'BT',
|
|
description: 'Begins a text object',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'32': {
|
|
name: 'endText',
|
|
keyword: 'ET',
|
|
description: 'Ends a text object',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'33': {
|
|
name: 'setCharSpacing',
|
|
keyword: 'Tc',
|
|
description: 'Sets the character spacing',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'34': {
|
|
name: 'setWordSpacing',
|
|
keyword: 'Tw',
|
|
description: 'Sets the word spacing',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'35': {
|
|
name: 'setHScale',
|
|
keyword: 'Tz',
|
|
description: 'Sets the horizontal scaling',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'36': {
|
|
name: 'setLeading',
|
|
keyword: 'TL',
|
|
description: 'Sets the text leading',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'37': {
|
|
name: 'setFont',
|
|
keyword: 'Tf',
|
|
description: 'Sets the text font and size',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'38': {
|
|
name: 'setTextRenderingMode',
|
|
keyword: 'Tr',
|
|
description: 'Sets the text rendering mode',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'39': {
|
|
name: 'setTextRise',
|
|
keyword: 'Ts',
|
|
description: 'Sets the text rise',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'40': {
|
|
name: 'moveText',
|
|
keyword: 'Td',
|
|
description: 'Moves to the start of the next line using offset coordinates',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'41': {
|
|
name: 'setLeadingMoveText',
|
|
keyword: 'TD',
|
|
description: 'Sets the text leading and moves to the next line',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'42': {
|
|
name: 'setTextMatrix',
|
|
keyword: 'Tm',
|
|
description: 'Sets the text matrix and text line matrix',
|
|
numArgs: 6,
|
|
variableArgs: false
|
|
},
|
|
'43': {
|
|
name: 'nextLine',
|
|
keyword: 'T*',
|
|
description: 'Moves to the start of the next line',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'44': {
|
|
name: 'showText',
|
|
keyword: 'Tj',
|
|
description: 'Shows a text string',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'45': {
|
|
name: 'showSpacedText',
|
|
keyword: 'TJ',
|
|
description: 'Shows a text string with individual glyph positioning',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'46': {
|
|
name: 'nextLineShowText',
|
|
keyword: '\'',
|
|
description: 'Moves to the next line and shows a text string',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'47': {
|
|
name: 'nextLineSetSpacingShowText',
|
|
keyword: '"',
|
|
description: 'Sets word and character spacing, moves to next line, and shows text',
|
|
numArgs: 3,
|
|
variableArgs: false
|
|
},
|
|
'48': {
|
|
name: 'setCharWidth',
|
|
keyword: 'd0',
|
|
description: 'Sets the character width information for Type 3 fonts',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'49': {
|
|
name: 'setCharWidthAndBounds',
|
|
keyword: 'd1',
|
|
description: 'Sets the character width and bounding box for Type 3 fonts',
|
|
numArgs: 6,
|
|
variableArgs: false
|
|
},
|
|
'50': {
|
|
name: 'setStrokeColorSpace',
|
|
keyword: 'CS',
|
|
description: 'Sets the color space for stroking operations',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'51': {
|
|
name: 'setFillColorSpace',
|
|
keyword: 'cs',
|
|
description: 'Sets the color space for nonstroking operations',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'52': {
|
|
name: 'setStrokeColor',
|
|
keyword: 'SC',
|
|
description: 'Sets the color for stroking operations',
|
|
numArgs: 4,
|
|
variableArgs: true
|
|
},
|
|
'53': {
|
|
name: 'setStrokeColorN',
|
|
keyword: 'SCN',
|
|
description: 'Sets the color for stroking operations (ICCBased and special color spaces)',
|
|
numArgs: 33,
|
|
variableArgs: true
|
|
},
|
|
'54': {
|
|
name: 'setFillColor',
|
|
keyword: 'sc',
|
|
description: 'Sets the color for nonstroking operations',
|
|
numArgs: 4,
|
|
variableArgs: true
|
|
},
|
|
'55': {
|
|
name: 'setFillColorN',
|
|
keyword: 'scn',
|
|
description: 'Sets the color for nonstroking operations (ICCBased and special color spaces)',
|
|
numArgs: 33,
|
|
variableArgs: true
|
|
},
|
|
'56': {
|
|
name: 'setStrokeGray',
|
|
keyword: 'G',
|
|
description: 'Sets the gray level for stroking operations',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'57': {
|
|
name: 'setFillGray',
|
|
keyword: 'g',
|
|
description: 'Sets the gray level for nonstroking operations',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'58': {
|
|
name: 'setStrokeRGBColor',
|
|
keyword: 'RG',
|
|
description: 'Sets the RGB color for stroking operations',
|
|
numArgs: 3,
|
|
variableArgs: false
|
|
},
|
|
'59': {
|
|
name: 'setFillRGBColor',
|
|
keyword: 'rg',
|
|
description: 'Sets the RGB color for nonstroking operations',
|
|
numArgs: 3,
|
|
variableArgs: false
|
|
},
|
|
'60': {
|
|
name: 'setStrokeCMYKColor',
|
|
keyword: 'K',
|
|
description: 'Sets the CMYK color for stroking operations',
|
|
numArgs: 4,
|
|
variableArgs: false
|
|
},
|
|
'61': {
|
|
name: 'setFillCMYKColor',
|
|
keyword: 'k',
|
|
description: 'Sets the CMYK color for nonstroking operations',
|
|
numArgs: 4,
|
|
variableArgs: false
|
|
},
|
|
'62': {
|
|
name: 'shadingFill',
|
|
keyword: 'sh',
|
|
description: 'Fills the current path using a shading pattern',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'63': {
|
|
name: 'beginInlineImage',
|
|
keyword: 'BI',
|
|
description: 'Begins an inline image object',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'64': {
|
|
name: 'beginImageData',
|
|
keyword: 'ID',
|
|
description: 'Begins the inline image data',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'65': {
|
|
name: 'endInlineImage',
|
|
keyword: 'EI',
|
|
description: 'Ends an inline image object',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'66': {
|
|
name: 'paintXObject',
|
|
keyword: 'Do',
|
|
description: 'Paints the specified XObject',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'67': {
|
|
name: 'markPoint',
|
|
keyword: 'MP',
|
|
description: 'Marks a point in the content stream',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'68': {
|
|
name: 'markPointProps',
|
|
keyword: 'DP',
|
|
description: 'Marks a point in the content stream with properties',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'69': {
|
|
name: 'beginMarkedContent',
|
|
keyword: 'BMC',
|
|
description: 'Begins a marked-content sequence',
|
|
numArgs: 1,
|
|
variableArgs: false
|
|
},
|
|
'70': {
|
|
name: 'beginMarkedContentProps',
|
|
keyword: 'BDC',
|
|
description: 'Begins a marked-content sequence with properties',
|
|
numArgs: 2,
|
|
variableArgs: false
|
|
},
|
|
'71': {
|
|
name: 'endMarkedContent',
|
|
keyword: 'EMC',
|
|
description: 'Ends a marked-content sequence',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'72': {
|
|
name: 'beginCompat',
|
|
keyword: 'BX',
|
|
description: 'Begins a compatibility section',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'73': {
|
|
name: 'endCompat',
|
|
keyword: 'EX',
|
|
description: 'Ends a compatibility section',
|
|
numArgs: 0,
|
|
variableArgs: false
|
|
},
|
|
'74': {
|
|
name: 'paintFormXObjectBegin',
|
|
keyword: null,
|
|
description: 'Begins painting a form XObject'
|
|
},
|
|
'75': {
|
|
name: 'paintFormXObjectEnd',
|
|
keyword: null,
|
|
description: 'Ends painting a form XObject'
|
|
},
|
|
'76': {
|
|
name: 'beginGroup',
|
|
keyword: null,
|
|
description: 'Begins a transparency group'
|
|
},
|
|
'77': {
|
|
name: 'endGroup',
|
|
keyword: null,
|
|
description: 'Ends a transparency group'
|
|
},
|
|
'80': {
|
|
name: 'beginAnnotation',
|
|
keyword: null,
|
|
description: 'Begins an annotation'
|
|
},
|
|
'81': {
|
|
name: 'endAnnotation',
|
|
keyword: null,
|
|
description: 'Ends an annotation'
|
|
},
|
|
'83': {
|
|
name: 'paintImageMaskXObject',
|
|
keyword: null,
|
|
description: 'Paints an image mask XObject'
|
|
},
|
|
'84': {
|
|
name: 'paintImageMaskXObjectGroup',
|
|
keyword: null,
|
|
description: 'Paints an image mask XObject group'
|
|
},
|
|
'85': {
|
|
name: 'paintImageXObject',
|
|
keyword: null,
|
|
description: 'Paints an image XObject'
|
|
},
|
|
'86': {
|
|
name: 'paintInlineImageXObject',
|
|
keyword: null,
|
|
description: 'Paints an inline image XObject'
|
|
},
|
|
'87': {
|
|
name: 'paintInlineImageXObjectGroup',
|
|
keyword: null,
|
|
description: 'Paints an inline image XObject group'
|
|
},
|
|
'88': {
|
|
name: 'paintImageXObjectRepeat',
|
|
keyword: null,
|
|
description: 'Paints a repeated image XObject'
|
|
},
|
|
'89': {
|
|
name: 'paintImageMaskXObjectRepeat',
|
|
keyword: null,
|
|
description: 'Paints a repeated image mask XObject'
|
|
},
|
|
'90': {
|
|
name: 'paintSolidColorImageMask',
|
|
keyword: null,
|
|
description: 'Paints a solid color image mask'
|
|
},
|
|
'91': {
|
|
name: 'constructPath',
|
|
keyword: null,
|
|
description: 'Constructs a path from the specified segments'
|
|
},
|
|
'92': {
|
|
name: 'setStrokeTransparent',
|
|
keyword: null,
|
|
description: 'Sets the stroke transparency'
|
|
},
|
|
'93': {
|
|
name: 'setFillTransparent',
|
|
keyword: null,
|
|
description: 'Sets the fill transparency'
|
|
}
|
|
};
|
|
|
|
console.log(opLookup[2]); // Example output for OpCode 2 (setLineWidth)
|