Thursday, 15 July 2010

javascript - PDF.JS ASP.NET MVC 4 -



javascript - PDF.JS ASP.NET MVC 4 -

i trying implement pdf.js asp.net mvc 4 web application. bundled appropriate scripts , using scripts below render pdf. ran javascript error font face. "failed build 'fontface': 2 arguments required, 1 present." help appreciated.

pdfjs.disablefontface = true; pdfjs.getdocument('/content/helloworld.pdf').then(function (pdf) { // using promise fetch page pdf.getpage(1).then(function (page) { var scale = 1.5; var viewport = page.getviewport(scale); // // prepare canvas using pdf page dimensions // var canvas = document.getelementbyid('the-canvas'); var context = canvas.getcontext('2d'); canvas.height = viewport.height; canvas.width = viewport.width; // // render pdf page canvas context // var rendercontext = { canvascontext: context, viewport: viewport }; page.render(rendercontext); }); });

javascript asp.net asp.net-mvc pdf

No comments:

Post a Comment