Fixes image and font embedding

This commit is contained in:
Yury Delendik 2014-08-14 15:11:27 -05:00
parent 0f862e7eb3
commit de23d3791e
3 changed files with 27 additions and 3 deletions

View file

@ -99,7 +99,7 @@ DOMElement.prototype = {
attrList.push(i + '="' + xmlEncode(this.attributes[i]) + '"');
}
if (this.nodeName === 'svg:tspan') {
if (this.nodeName === 'svg:tspan' || this.nodeName === 'svg:style') {
var encText = xmlEncode(this.textContent);
return '<' + this.nodeName + ' ' + attrList.join(' ') + '>' +
encText + '</' + this.nodeName + '>';

View file

@ -65,6 +65,7 @@ PDFJS.getDocument(data).then(function (doc) {
return page.getOperatorList().then(function (opList) {
var svgGfx = new PDFJS.SVGGraphics(page.commonObjs, page.objs);
svgGfx.embedFonts = true;
return svgGfx.getSVG(opList, viewport).then(function (svg) {
var svgDump = svg.toString();
writeToFile(svgDump, pageNum);