Parsing PDF pages as javascript Images

后端 未结 2 903
离开以前
离开以前 2020-12-08 22:11

As per title, is there any way I can parse pages from an unprotected PDF file as javascript Image() objects?

It would also be ok to convert them before running the j

相关标签:
2条回答
  • 2020-12-08 22:42

    PDF.js will let you render the PDF to a canvas. Then you can do something like:

    var img = new Image();
    img.src = pdfCanvas.toDataURL();
    

    I've been very impressed with PDF.js. I love letting the client's browser do as much of the work for me as possible.

    Demo here: http://jsbin.com/pdfjs-helloworld-v2/1/edit

    0 讨论(0)
  • 2020-12-08 23:05

    Looks like the first issue is a missing executable: identify. This is part of ImageMagick:

    http://www.imagemagick.org/script/index.php

    Make sure you also have it in your path.

    0 讨论(0)
提交回复
热议问题