);
if ('Form' == type.name) {
- args[0].code = this.evaluate(xobj, xref,
- xobj.dict.get('Resources'), fonts,
- images);
+ // console.log("got xobj that is a Form");
+ args[0].code = this.eval(xobj, xref, xobj.dict.get('Resources'),
+ fonts, images);
}
- if (xobj instanceof JpegStream)
+ if (xobj instanceof JpegStream) {
images.bind(xobj); // monitoring image load
+ // console.log("got xobj that is a JpegStream");
+ }
+
+ if (xobj.dict.get('Subtype').name == "Image") {
+ // Check if we have an image that is not rendered by the platform.
+ // Needs to be rendered ourself.
+ if (!(xobj instanceof JpegStream)) {
+ var image = xobj;
+ var dict = image.dict;
+ var w = dict.get('Width', 'W');
+ var h = dict.get('Height', 'H');
+
+ var inline = false;
+
+ var imageObj = new PDFImage(xref, resources, image, inline);
+
+ console.log("xobj subtype image", w, h, imageObj.imageMask);
+ }
+ }
+ console.log("xobj subtype", xobj.dict.get('Subtype').name);
+
}
} else if (cmd == 'Tf') { // eagerly collect all fonts
var fontName = args[0].name;
}
}
+ var skips = ["paintXObject"];
+
+ if (skips.indexOf(fn) != -1) {
+ // console.log("skipping", fn);
+ args = [];
+ continue;
+ }
+
fnArray.push(fn);
argsArray.push(args);
args = [];
// TODO: Handle images here.
+ console.log("about to send page", pageNum);
+
+ // Make a copy of the fnArray and show all cmds it has.
+ var fnArray = preCompilation.fnArray.slice(0).sort();
+ for (var i = 0; i < fnArray.length; true) {
+ if (fnArray[i] == fnArray[i + 1]) {
+ fnArray.splice(i, 1);
+ } else {
+ i++;
+ }
+ }
+ console.log("cmds", fnArray);
+
+
handler.send("page", {
pageNum: pageNum,
fonts: fontsMin,