简体   繁体   English

如何在不使用需要安装外部应用程序的库的情况下将 pdf 文件转换为 nodejs 中的图像

[英]How to convert pdf file into image in nodejs without using libraries that needs installing external applications

I am developing an api by nodejs(expressjs) and there is a scenario in which I need to convert the pdf files which are uploaded to the server, into images(jpeg, png, ...).我正在通过 nodejs(expressjs) 开发一个 api,并且有一个场景我需要将上传到服务器的 pdf 文件转换为图像(jpeg、png、...)。 I wanted a npm package to just give the pdf and it does the conversion but although I did a lot of research but all the solutions and libraries that was recommended, needed to install external applications like imageMagic and ... to do the job.我想要一个 npm 包只提供 pdf 并进行转换,但尽管我做了很多研究,但推荐的所有解决方案和库都需要安装外部应用程序,如 imageMagic 和......来完成这项工作。 It's not what I'm looking for, I prefer to just use a package which does not need any external applications.这不是我要找的,我更喜欢只使用不需要任何外部应用程序的包。

"https://www.npmjs.com/package/sharp" Download sharp package. "https://www.npmjs.com/package/sharp" 下载sharp包。 It doesn't need any external apps它不需要任何外部应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM