如何使用angularjs将单页PDF文档转换为预览图像

时间:2021-02-12 01:35:45

As my question says .. I want to show my pdf file as a preview image(size of a thumb nail) when clicked on, using angularjs.

我的问题是……我想要显示我的pdf文件作为预览图像(拇指指甲大小),当点击时,使用angularjs。

So far i have only found ways on how to view a pdf file on a webpage or how to preview image before uploading.

到目前为止,我只找到了如何在网页上查看pdf文件或如何在上传前预览图像的方法。

Any idea on which directives i can use or a path that i should follow.

任何我可以使用的指令或者我应该遵循的路径。

I am lost beyond hope.

我失去了希望。

Any help no matter how small, is welcome. Thanks in advance.

任何帮助,无论多么小,都是受欢迎的。提前谢谢。

1 个解决方案

#1


2  

I think, you can achieve this only by using some backend workaround. You must prepeare preview image for PDF.

我认为,只有使用一些后端解决方案才能实现这一点。您必须预配PDF的预览图像。

You can use pdftk to get first page of PDF. Then you can convert it to image using imagemagic. Here is some workaround. I hove it will help you.

您可以使用pdftk获得第一页的PDF。然后你可以用imagemagic把它转换成图像。这里有一些解决方案。我认为这对你有帮助。

#1


2  

I think, you can achieve this only by using some backend workaround. You must prepeare preview image for PDF.

我认为,只有使用一些后端解决方案才能实现这一点。您必须预配PDF的预览图像。

You can use pdftk to get first page of PDF. Then you can convert it to image using imagemagic. Here is some workaround. I hove it will help you.

您可以使用pdftk获得第一页的PDF。然后你可以用imagemagic把它转换成图像。这里有一些解决方案。我认为这对你有帮助。