pdfdataextract
Version:
Extract data from a pdf with pure javascript
936 lines • 31.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentInfoExtractor = exports.TextRenderingMode = exports.ClipType = exports.LineJoin = exports.LineCap = exports.ImageContent = exports.TextContent = exports.PathInfo = exports.ContentInfo = exports.ImageKind = void 0;
const pdf_mjs_1 = require("pdfjs-dist/legacy/build/pdf.mjs");
var ImageKind;
(function (ImageKind) {
/**
*
*/
ImageKind[ImageKind["GRAYSCALE_1BPP"] = 1] = "GRAYSCALE_1BPP";
/**
*
*/
ImageKind[ImageKind["RGB_24BPP"] = 2] = "RGB_24BPP";
/**
*
*/
ImageKind[ImageKind["RGBA_32BPP"] = 3] = "RGBA_32BPP";
})(ImageKind || (exports.ImageKind = ImageKind = {}));
/**
*
*/
class ContentInfo {
}
exports.ContentInfo = ContentInfo;
/**
*
*/
class PathInfo extends ContentInfo {
/**
* @param path
* @param open
* @param stroke
* @param fill
*/
constructor(path, open, stroke, fill) {
super();
this.path = path;
this.open = open;
this.stroke = stroke;
this.fill = fill;
}
}
exports.PathInfo = PathInfo;
/**
*
*/
class TextContent extends ContentInfo {
/**
* @param text
*/
constructor(text) {
super();
this.text = text;
}
}
exports.TextContent = TextContent;
/**
*
*/
class ImageContent extends ContentInfo {
/**
* @param width
* @param height
* @param kind
* @param data
*/
constructor(width, height, kind = ImageKind.GRAYSCALE_1BPP, data) {
super();
this.width = width;
this.height = height;
this.kind = kind;
this.data = data;
}
}
exports.ImageContent = ImageContent;
var FontType;
(function (FontType) {
FontType["CIDFONTTYPE0"] = "CIDFONTTYPE0";
FontType["CIDFONTTYPE0C"] = "CIDFONTTYPE0C";
FontType["CIDFONTTYPE2"] = "CIDFONTTYPE2";
FontType["MMTYPE1"] = "MMTYPE1";
FontType["OPENTYPE"] = "OPENTYPE";
FontType["TRUETYPE"] = "TRUETYPE";
FontType["TYPE0"] = "TYPE0";
FontType["TYPE1"] = "TYPE1";
FontType["TYPE1C"] = "TYPE1C";
FontType["TYPE1STANDARD"] = "TYPE1STANDARD";
FontType["TYPE3"] = "TYPE3";
FontType["UNKNOWN"] = "UNKNOWN";
})(FontType || (FontType = {}));
var LineCap;
(function (LineCap) {
/**
*
*/
LineCap[LineCap["BUTT"] = 0] = "BUTT";
/**
*
*/
LineCap[LineCap["ROUND"] = 1] = "ROUND";
/**
*
*/
LineCap[LineCap["SQUARE"] = 2] = "SQUARE";
})(LineCap || (exports.LineCap = LineCap = {}));
var LineJoin;
(function (LineJoin) {
/**
*
*/
LineJoin[LineJoin["MITER"] = 0] = "MITER";
/**
*
*/
LineJoin[LineJoin["ROUND"] = 1] = "ROUND";
/**
*
*/
LineJoin[LineJoin["BEVEL"] = 2] = "BEVEL";
})(LineJoin || (exports.LineJoin = LineJoin = {}));
var ClipType;
(function (ClipType) {
/**
*
*/
ClipType[ClipType["NORMAL"] = 0] = "NORMAL";
/**
*
*/
ClipType[ClipType["EO"] = 1] = "EO";
})(ClipType || (exports.ClipType = ClipType = {}));
var TextRenderingMode;
(function (TextRenderingMode) {
/**
*
*/
TextRenderingMode[TextRenderingMode["FILL"] = 0] = "FILL";
/**
*
*/
TextRenderingMode[TextRenderingMode["STROKE"] = 1] = "STROKE";
/**
*
*/
TextRenderingMode[TextRenderingMode["FILL_STROKE"] = 2] = "FILL_STROKE";
/**
*
*/
TextRenderingMode[TextRenderingMode["INVISIBLE"] = 3] = "INVISIBLE";
/**
*
*/
TextRenderingMode[TextRenderingMode["FILL_ADD_TO_PATH"] = 4] = "FILL_ADD_TO_PATH";
/**
*
*/
TextRenderingMode[TextRenderingMode["STROKE_ADD_TO_PATH"] = 5] = "STROKE_ADD_TO_PATH";
/**
*
*/
TextRenderingMode[TextRenderingMode["FILL_STROKE_ADD_TO_PATH"] = 6] = "FILL_STROKE_ADD_TO_PATH";
/**
*
*/
TextRenderingMode[TextRenderingMode["ADD_TO_PATH"] = 7] = "ADD_TO_PATH";
/**
*
*/
TextRenderingMode[TextRenderingMode["FILL_STROKE_MASK"] = 3] = "FILL_STROKE_MASK";
/**
*
*/
TextRenderingMode[TextRenderingMode["ADD_TO_PATH_FLAG"] = 4] = "ADD_TO_PATH_FLAG";
})(TextRenderingMode || (exports.TextRenderingMode = TextRenderingMode = {}));
class ContentInfoExtractorState {
constructor() {
this.lineWidth = 1;
this.textMatrixScale = 1;
this.path = [];
this.pathOpen = true;
this.leading = 0;
this.lineX = 0;
this.lineY = 0;
this.x = 0;
this.y = 0;
this.strokeColor = 0;
this.fillColor = 0;
this.textRise = 0;
this.charSpacing = 0;
this.wordSpacing = 0;
this.hScale = 0;
this.textRenderingMode = TextRenderingMode.FILL;
this.fontSize = 0;
this.fontDirection = 1;
this.blendMode = "source-over";
}
}
/**
*
*/
class ContentInfoExtractor {
/**
* @param page
*/
constructor(page) {
this.contentInfo = [];
this.state = new ContentInfoExtractorState();
this.clipType = null;
this.stateStack = [];
this.page = page;
this.commonObjs = page.commonObjs;
this.objs = page.objs;
}
/**
*
*/
async getContentInfo() {
if (this.contentInfo.length > 0)
return this.contentInfo;
const operatorList = await this.page.getOperatorList();
await ContentInfoExtractor.loadDependencies(this.page, operatorList);
this.fromOperatorList(operatorList);
return this.contentInfo;
}
setLineWidth(width) {
this.state.lineWidth = width;
}
setLineCap(lineCap) {
this.state.lineCap = lineCap;
}
setLineJoin(lineJoin) {
this.state.lineJoin = lineJoin;
}
setMiterLimit(miterLimit) {
this.state.miterLimit = miterLimit;
}
setDash(dashArray, dashPhase) {
this.state.dashArray = dashArray;
this.state.dashPhase = dashPhase;
}
setGState(states) {
for (const [key, value] of states) {
switch (key) {
case 'LW':
this.setLineWidth(value);
break;
case 'LC':
this.setLineCap(value);
break;
case 'LJ':
this.setLineJoin(value);
break;
case 'ML':
this.setMiterLimit(value);
break;
case 'D':
const d = value;
this.setDash(d[0], d[1]);
break;
//case 'RI':
//case 'FL':
case 'Font':
const f = value;
this.setFont(f[0], f[1]);
break;
case 'CA':
this.setStrokeAlpha(value);
break;
case 'ca':
this.setFillAlpha(value);
break;
case 'BM':
this.setBlendMode(value);
break;
case 'SMask':
this.setSMask(value);
break;
case 'TR':
break;
case 'OP':
case 'op':
case 'OPM':
case 'BG':
case 'BG2':
case 'UCR':
case 'UCR2':
case 'TR2':
case 'HT':
case 'SM':
case 'SA':
case 'AIS':
case 'TK':
break;
}
}
}
save() {
this.stateStack.push(this.state);
this.state = Object.create(this.state);
}
restore() {
const restoredState = this.stateStack.pop();
if (restoredState)
this.state = restoredState;
this.clipType = null;
}
transform(scaleX, shearX, shearY, scaleY, offsetX, offsetY) {
const oldMatrix = this.state.transformMatrix;
if (oldMatrix == null) {
this.state.transformMatrix = [scaleX, shearX, shearY, scaleY, offsetX, offsetY];
}
else {
this.state.transformMatrix = [
oldMatrix[0] * scaleX + oldMatrix[2] * shearX,
oldMatrix[1] * scaleX + oldMatrix[3] * shearX,
oldMatrix[0] * shearY + oldMatrix[2] * scaleY,
oldMatrix[1] * shearY + oldMatrix[3] * scaleY,
oldMatrix[0] * offsetX + oldMatrix[2] * offsetY + oldMatrix[4],
oldMatrix[1] * offsetX + oldMatrix[3] * offsetY + oldMatrix[5],
];
}
}
closePath() {
this.state.pathOpen = false;
}
stroke() {
this.contentInfo.push(new PathInfo(this.state.path, this.state.pathOpen, {
color: this.state.strokeColor,
width: this.state.lineWidth
}, null));
this.endPath();
}
closeStroke() {
this.closePath();
this.stroke();
}
fill() {
this.contentInfo.push(new PathInfo(this.state.path, this.state.pathOpen, null, {
color: this.state.fillColor,
eo: false,
}));
this.endPath();
}
eoFill() {
this.contentInfo.push(new PathInfo(this.state.path, this.state.pathOpen, null, {
color: this.state.fillColor,
eo: true,
}));
this.endPath();
}
fillStroke() {
this.contentInfo.push(new PathInfo(this.state.path, this.state.pathOpen, {
color: this.state.strokeColor,
width: this.state.lineWidth
}, {
color: this.state.fillColor,
eo: false,
}));
this.endPath();
}
eoFillStroke() {
this.contentInfo.push(new PathInfo(this.state.path, this.state.pathOpen, {
color: this.state.strokeColor,
width: this.state.lineWidth
}, {
color: this.state.fillColor,
eo: true,
}));
this.endPath();
}
closeFillStroke() {
this.closePath();
this.fillStroke();
}
closeEOFillStroke() {
this.closePath();
this.eoFillStroke();
}
endPath() {
if (this.clipType) {
}
this.state.path = [];
}
clip() {
this.clipType = ClipType.NORMAL;
}
eoClip() {
this.clipType = ClipType.EO;
}
beginText() {
this.state.x = this.state.lineX = 0;
this.state.y = this.state.lineY = 0;
this.state.textMatrix = undefined;
this.state.textMatrixScale = 1;
}
endText() {
}
setCharSpacing(spacing) {
this.state.charSpacing = spacing;
}
setWordSpacing(spacing) {
this.state.wordSpacing = spacing;
}
setHScale(scale) {
this.state.hScale = scale / 100;
}
setLeading(leading) {
this.state.leading = -leading;
}
setFont(fontName, fontSize) {
const font = this.commonObjs.get(fontName);
this.state.font = font;
if (fontSize < 0) {
this.state.fontSize = fontSize;
this.state.fontDirection = -1;
}
else {
this.state.fontSize = fontSize = -fontSize;
this.state.fontDirection = 1;
}
}
setTextRenderingMode(mode) {
this.state.textRenderingMode = mode;
}
setTextRise(rise) {
this.state.textRise = rise;
}
moveText(x, y) {
this.state.x = this.state.lineX += x;
this.state.y = this.state.lineY += y;
}
setLeadingMoveText(x, y) {
this.setLeading(-y);
this.moveText(x, y);
}
setTextMatrix(scaleX, shearX, shearY, scaleY, offsetX, offsetY) {
this.state.textMatrix = [scaleX, shearX, shearY, scaleY, offsetX, offsetY];
this.state.textMatrixScale = Math.hypot(scaleX, shearX);
this.state.x = this.state.lineX = 0;
this.state.y = this.state.lineY = 0;
}
nextLine() {
this.moveText(0, this.state.leading);
}
showText(glyphs) {
const font = this.state.font;
if (font == null)
return;
const fontSize = this.state.fontSize;
if (fontSize === 0)
return;
const charSpacing = this.state.charSpacing;
const wordSpacing = this.state.wordSpacing;
const fontDirection = this.state.fontDirection;
const hScale = this.state.hScale * fontDirection;
const vertical = font.vertical;
const spacingDir = vertical ? 1 : -1;
const defaultVMetrics = font.defaultVMetrics;
const widthAdvanceScale = fontSize * (this.state.fontMatrix == null ? 1 : this.state.fontMatrix[0]);
let textContent = '';
let x = 0;
for (const glyph of glyphs) {
if (glyph === null) {
x += fontDirection * wordSpacing;
}
else if (typeof glyph === 'number') {
x += (spacingDir * glyph * fontSize) / 1000;
}
else {
const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;
const character = glyph.fontChar;
let scaledX, scaledY;
let width = glyph.width;
if (vertical) {
let vx;
const vmetric = glyph.vmetric || defaultVMetrics;
vx = glyph.vmetric ? vmetric[1] : width * 0.5;
vx = -vx * widthAdvanceScale;
const vy = vmetric[2] * widthAdvanceScale;
width = vmetric ? -vmetric[0] : width;
scaledX = vx / 1;
scaledY = (x + vy) / 1;
}
else {
scaledX = x / 1;
scaledY = 0;
}
if (glyph.isInFont || font.missingFile) {
// TODO
textContent += character;
}
else {
}
let charWidth;
if (vertical) {
charWidth = width * widthAdvanceScale - spacing * fontDirection;
}
else {
charWidth = width * widthAdvanceScale + spacing * fontDirection;
}
x += charWidth;
}
}
this.contentInfo.push(new TextContent(textContent));
if (vertical) {
this.state.y -= x;
}
else {
this.state.x += x * hScale;
}
}
setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {
}
setStrokeAlpha(a) {
this.state.strokeColor = (a << 24) | (this.state.strokeColor & 0xffffff);
}
setStrokeRGBColor(r, g, b) {
this.state.strokeColor = ((this.state.strokeColor >>> 24) << 24) | (r << 16) | (g << 8) | b;
}
setFillAlpha(a) {
this.state.fillColor = (a << 24) | (this.state.fillColor & 0xffffff);
}
setFillRGBColor(r, g, b) {
this.state.fillColor = ((this.state.fillColor >>> 24) << 24) | (r << 16) | (g << 8) | b;
}
setBlendMode(mode) {
this.state.blendMode = mode;
}
setSMask(mask) {
//this.state.sMask = mask;
}
shadingFill(shadingName) {
const shading = this.commonObjs.get(shadingName);
}
beginMarkedContent() {
}
beginMarkedContentProps() {
}
endMarkedContent() {
}
paintFormXObjectBegin(matrix, bbox) {
}
paintFormXObjectEnd() {
}
beginGroup() {
}
endGroup() {
}
beginAnnotation() {
}
endAnnotation() {
}
paintImageMaskXObject() {
}
paintImageMaskXObjectGroup() {
}
paintImageXObject(imageName) {
this.paintInlineImageXObject((imageName.startsWith('g_') ? this.commonObjs.get(imageName) : this.objs.get(imageName)));
}
paintInlineImageXObject(imageData) {
this.contentInfo.push(new ImageContent(imageData.width, imageData.height, imageData.kind, imageData.data));
}
paintSolidColorImageMask() {
}
constructPath(ops, args) {
if (!this.state.pathOpen)
this.state.path = [];
const path = this.state.path;
let x = 0;
let y = 0;
for (let i = 0, a = 0; i < ops.length; i++) {
switch (ops[i]) {
case pdf_mjs_1.OPS.moveTo: {
x = args[a++];
y = args[a++];
break;
}
case pdf_mjs_1.OPS.lineTo: {
path.push([x, y, args[a++], args[a++]]);
break;
}
case pdf_mjs_1.OPS.curveTo: {
const cp1x = args[a++];
const cp1y = args[a++];
const cp2x = args[a++];
const cp2y = args[a++];
x = args[a++];
y = args[a++];
path.push([cp1x, cp1y, cp2x, cp2y, x, y]);
break;
}
case pdf_mjs_1.OPS.curveTo2: {
const cp2x = args[a++];
const cp2y = args[a++];
x = args[a++];
y = args[a++];
path.push([x, y, cp2x, cp2y, x, y]);
break;
}
case pdf_mjs_1.OPS.curveTo3: {
const cp1x = args[a++];
const cp1y = args[a++];
x = args[a++];
y = args[a++];
path.push([cp1x, cp1y, x, y, x, y]);
break;
}
case pdf_mjs_1.OPS.closePath:
if (path.length > 0) {
this.state.pathOpen = false;
}
break;
case pdf_mjs_1.OPS.rectangle:
x = args[a++];
y = args[a++];
const width = args[a++];
const height = args[a++];
const xwidth = x + width;
const yheight = y + height;
path.push([x, y, xwidth, y]);
path.push([xwidth, y, xwidth, yheight]);
path.push([xwidth, yheight, x, yheight]);
path.push([x, yheight, x, y]);
break;
}
}
}
setStrokeTransparent() {
this.state.strokeColor = 0x000000;
}
setFillTransparent() {
this.state.fillColor = 0x000000;
}
static async loadDependencies(data, operatorList) {
const dependencies = [];
for (let i = 0; i < operatorList.fnArray.length; i++) {
if (operatorList.fnArray[i] != pdf_mjs_1.OPS.dependency)
continue;
for (const arg of operatorList.argsArray[i]) {
const objs = arg.startsWith('g_') ? data.commonObjs : data.objs;
dependencies.push(new Promise(resolve => {
objs.get(arg, resolve);
}));
}
}
return Promise.all(dependencies);
}
fromOperatorList(operatorList) {
const mapping = [];
for (const t of Object.keys(pdf_mjs_1.OPS)) {
mapping[pdf_mjs_1.OPS[t]] = t;
}
for (let i = 0; i < operatorList.fnArray.length; i++) {
const args = operatorList.argsArray[i];
console.log(mapping[operatorList.fnArray[i]], args);
}
for (let i = 0; i < operatorList.fnArray.length; i++) {
const args = operatorList.argsArray[i];
switch (operatorList.fnArray[i]) {
//case OPS.dependency:
// this.dependency(args);
// break;
case pdf_mjs_1.OPS.setLineWidth:
this.setLineWidth(args[0]);
break;
case pdf_mjs_1.OPS.setLineCap:
this.setLineCap(args[0]);
break;
case pdf_mjs_1.OPS.setLineJoin:
this.setLineJoin(args[0]);
break;
case pdf_mjs_1.OPS.setMiterLimit:
this.setMiterLimit(args[0]);
break;
case pdf_mjs_1.OPS.setDash:
this.setDash(args[0], args[1]);
break;
//case OPS.setRenderingIntent:
// this.setRenderingIntent(args[0]);
// break;
//case OPS.setFlatness:
// this.setFlatness(args[0]);
// break;
case pdf_mjs_1.OPS.setGState:
this.setGState(args[0]);
break;
case pdf_mjs_1.OPS.save:
this.save();
break;
case pdf_mjs_1.OPS.restore:
this.restore();
break;
case pdf_mjs_1.OPS.transform:
this.transform(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
//case OPS.moveTo:
// this.moveTo(args[0], args[1]);
// break;
//case OPS.lineTo:
// this.lineTo(args[0], args[1]);
// break;
//case OPS.curveTo:
// this.curveTo(args[0], args[1], args[3], args[4], args[5], args[6]);
// break;
//case OPS.curveTo2:
// this.curveTo2(0, 0, args[0], args[1], args[2], args[3]);
// break;
//case OPS.curveTo3:
// this.curveTo3(args[0], args[1], args[2], args[3]);
// break;
//case OPS.closePath:
// this.closePath();
// break;
//case OPS.rectangle:
// this.rectangle(args[0], args[1], args[2], args[3]);
// break;
case pdf_mjs_1.OPS.stroke:
this.stroke();
break;
case pdf_mjs_1.OPS.closeStroke:
this.closeStroke();
break;
case pdf_mjs_1.OPS.fill:
this.fill();
break;
case pdf_mjs_1.OPS.eoFill:
this.eoFill();
break;
case pdf_mjs_1.OPS.fillStroke:
this.fillStroke();
break;
case pdf_mjs_1.OPS.eoFillStroke:
this.eoFillStroke();
break;
case pdf_mjs_1.OPS.closeFillStroke:
this.closeFillStroke();
break;
case pdf_mjs_1.OPS.closeEOFillStroke:
this.closeEOFillStroke();
break;
case pdf_mjs_1.OPS.endPath:
this.endPath();
break;
case pdf_mjs_1.OPS.clip:
this.clip();
break;
case pdf_mjs_1.OPS.eoClip:
this.eoClip();
break;
case pdf_mjs_1.OPS.beginText:
this.beginText();
break;
case pdf_mjs_1.OPS.endText:
this.endText();
break;
case pdf_mjs_1.OPS.setCharSpacing:
this.setCharSpacing(args[0]);
break;
case pdf_mjs_1.OPS.setWordSpacing:
this.setWordSpacing(args[0]);
break;
case pdf_mjs_1.OPS.setHScale:
this.setHScale(args[0]);
break;
case pdf_mjs_1.OPS.setLeading:
this.setLeading(args);
break;
case pdf_mjs_1.OPS.setFont:
this.setFont(args[0], args[1]);
break;
case pdf_mjs_1.OPS.setTextRenderingMode:
this.setTextRenderingMode(args[0]);
break;
case pdf_mjs_1.OPS.setTextRise:
this.setTextRise(args[0]);
break;
case pdf_mjs_1.OPS.moveText:
this.moveText(args[0], args[1]);
break;
case pdf_mjs_1.OPS.setLeadingMoveText:
this.setLeadingMoveText(args[0], args[1]);
break;
case pdf_mjs_1.OPS.setTextMatrix:
this.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
case pdf_mjs_1.OPS.nextLine:
this.nextLine();
break;
case pdf_mjs_1.OPS.showText:
this.showText(args[0]);
break;
//case OPS.showSpacedText:
// this.showSpacedText(args[0]);
// break;
//case OPS.nextLineShowText:
// this.nextLineShowText(args[0]);
// break;
//case OPS.nextLineSetSpacingShowText:
// this.nextLineSetSpacingShowText(args[0], args[1], args[2]);
// break;
//case OPS.setCharWidth:
// this.setCharWidth(args[0], args[1]);
// break;
case pdf_mjs_1.OPS.setCharWidthAndBounds:
this.setCharWidthAndBounds(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
//case OPS.setStrokeColorSpace:
// this.setStrokeColorSpace();
// break;
//case OPS.setFillColorSpace:
// this.setFillColorSpace();
// break;
//case OPS.setStrokeColor:
// this.setStrokeColor();
// break;
//case OPS.setStrokeColorN:
// this.setStrokeColorN();
// break;
//case OPS.setFillColor:
// this.setFillColor();
// break;
//case OPS.setFillColorN:
// this.setFillColorN();
// break;
//case OPS.setStrokeGray:
// this.setStrokeGray(args[0]);
// break;
//case OPS.setFillGray:
// this.setFillGray(args[0]);
// break;
case pdf_mjs_1.OPS.setStrokeRGBColor:
this.setStrokeRGBColor(args[0], args[1], args[2]);
break;
case pdf_mjs_1.OPS.setFillRGBColor:
this.setFillRGBColor(args[0], args[1], args[2]);
break;
//case OPS.setStrokeCMYKColor:
// this.setStrokeCMYKColor(args[0], args[1], args[2], args[3]);
// break;
//case OPS.setFillCMYKColor:
// this.setFillCMYKColor(args[0], args[1], args[2], args[3]);
// break;
case pdf_mjs_1.OPS.shadingFill:
this.shadingFill(args[0]);
break;
//case OPS.beginInlineImage:
// this.beginInlineImage();
// break;
//case OPS.beginImageData:
// this.beginImageData();
// break;
//case OPS.endInlineImage:
// this.endInlineImage();
// break;
//case OPS.paintXObject:
// this.paintXObject();
// break;
//case OPS.markPoint:
// this.markPoint();
// break;
//case OPS.markPointProps:
// this.markPointProps();
// break;
case pdf_mjs_1.OPS.beginMarkedContent:
this.beginMarkedContent();
break;
case pdf_mjs_1.OPS.beginMarkedContentProps:
this.beginMarkedContentProps();
break;
case pdf_mjs_1.OPS.endMarkedContent:
this.endMarkedContent();
break;
//case OPS.beginCompat:
// this.beginCompat();
// break;
//case OPS.endCompat:
// this.endCompat();
// break;
case pdf_mjs_1.OPS.paintFormXObjectBegin:
this.paintFormXObjectBegin(args[0], args[1]);
break;
case pdf_mjs_1.OPS.paintFormXObjectEnd:
this.paintFormXObjectEnd();
break;
case pdf_mjs_1.OPS.beginGroup:
this.beginGroup();
break;
case pdf_mjs_1.OPS.endGroup:
this.endGroup();
break;
case pdf_mjs_1.OPS.beginAnnotation:
this.beginAnnotation();
break;
case pdf_mjs_1.OPS.endAnnotation:
this.endAnnotation();
break;
case pdf_mjs_1.OPS.paintImageMaskXObject:
this.paintImageMaskXObject();
break;
case pdf_mjs_1.OPS.paintImageMaskXObjectGroup:
this.paintImageMaskXObjectGroup();
break;
case pdf_mjs_1.OPS.paintImageXObject:
this.paintImageXObject(args[0]);
break;
//case OPS.paintInlineImageXObject:
// this.paintInlineImageXObject(args[0]);
// break;
//case OPS.paintInlineImageXObjectGroup:
// this.paintInlineImageXObjectGroup(args[0], args[1]);
// break;
//case OPS.paintImageXObjectRepeat:
// this.paintImageXObjectRepeat(args[0], args[1], args[2], args[3]);
// break;
//case OPS.paintImageMaskXObjectRepeat:
// this.paintImageMaskXObjectRepeat();
// break;
case pdf_mjs_1.OPS.paintSolidColorImageMask:
this.paintSolidColorImageMask();
break;
case pdf_mjs_1.OPS.constructPath:
this.constructPath(args[0], args[1]);
break;
case pdf_mjs_1.OPS.setStrokeTransparent:
this.setStrokeTransparent();
break;
case pdf_mjs_1.OPS.setFillTransparent:
this.setFillTransparent();
break;
}
}
}
}
exports.ContentInfoExtractor = ContentInfoExtractor;
//# sourceMappingURL=contentinfoextractor.js.map