如何将PDF页面渲染为SVG

时间:2019-08-21 13:55:07

标签: html svg canvas pdfjs

在helloworld的示例中,pdf页面正在渲染到画布中。我想知道如何将pdf页面呈现为svg?


// Hello World
// http://mozilla.github.io/pdf.js/examples/
var scale = 1.5;
var viewport = page.getViewport({ scale: scale, });

var canvas = document.getElementById('the-canvas');
var context = canvas.getContext('2d');
canvas.height = viewport.height;
canvas.width = viewport.width;

var renderContext = {
  canvasContext: context,
  viewport: viewport
};
page.render(renderContext);

// ...

0 个答案:

没有答案