1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Hack something up that renders font right again

This commit is contained in:
Julian Viereck 2011-10-08 18:15:18 +02:00
parent 4258da35db
commit 75884a6160
3 changed files with 134 additions and 273 deletions

View file

@ -10,7 +10,7 @@ var WorkerProcessorHandler = {
handler.on("doc", function(data) {
// Create only the model of the PDFDoc, which is enough for
// processing the content of the pdf.
pdfDoc = new PDFDocModel(new Stream(data));
pdfDoc = data;//new PDFDocModel(new Stream(data));
});
handler.on("page_request", function(pageNum) {
@ -50,19 +50,26 @@ var WorkerProcessorHandler = {
}
// Filter the dependecies for fonts.
var fonts = {};
// var fonts = {};
// for (var i = 0; i < dependency.length; i++) {
// var dep = dependency[i];
// if (dep.indexOf('font_') == 0) {
// fonts[dep] = true;
// }
// }
var fonts = [];
for (var i = 0; i < dependency.length; i++) {
var dep = dependency[i];
if (dep.indexOf('font_') == 0) {
fonts[dep] = true;
if (typeof dep === "object") {
fonts.push(dep);
}
}
handler.send("page", {
pageNum: pageNum,
IRQueue: IRQueue,
depFonts: Object.keys(fonts)
depFonts: fonts
});
}, this);