https://github.com/notadd/nt-pdf2png
pdf 转 png 方案 ,基于 https://github.com/mooz/node-pdf-image
https://github.com/notadd/nt-pdf2png
Last synced: 4 months ago
JSON representation
pdf 转 png 方案 ,基于 https://github.com/mooz/node-pdf-image
- Host: GitHub
- URL: https://github.com/notadd/nt-pdf2png
- Owner: notadd
- License: apache-2.0
- Created: 2018-10-18T07:01:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-12-13T05:51:10.000Z (over 1 year ago)
- Last Synced: 2025-04-02T10:21:50.465Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 11 MB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nt-pdf2png
pdf 转 png 方案,尽在用户访问时转换,大大节省了服务器资源,秒开。
### ubuntu
```
sudo apt-get install imagemagick ghostscript poppler-utils
```
### OSX (Yosemite)
```
brew install imagemagick ghostscript poppler
```
## 使用 (use)
1. 修改配置文件
一般在: `/etc/ImageMagick-6/policy.xml`
将文件末尾三行改为
```
```
2. 克隆项目,在项目下 npm install
```
npm install
```
3. 运行
```
npm run start
```
4. 访问 `http://localhost:3000/test/test.pdf/0.png`
test.pdf 为文件名, 0.png 为页码(第一页是0)。
## todo
- [ ] 使用 typescript 重写
- [ ] 使用 sharp 替代现有库