pdf2thumbnail
Advanced tools
Changelog
[1.0.7] - 2023/6/8
Changelog
[1.0.6] - 2023/6/8
Changelog
[1.0.5] - 2023/6/8
Changelog
[1.0.3] - 2022/12/21
Merged images of all page thumbnails have been added to the write-up results.
The merged image file will be written to the output directory with the same name as the PDF.
The following options related to images to be merged have been added.
const pdf2thumbnail = require('pdf2thumbnail');
await pdf2thumbnail.writeThumbnails('sample.pdf', './result', {
offset: 30,
background: '#000'
});
Added thumbnail archive option.
If the archive option is true, an archive (zip) containing all thumbnails is created.
The archive file name will be <output directory name>.zip.
const pdf2thumbnail = require('pdf2thumbnail');
await pdf2thumbnail.writeThumbnails('sample.pdf', './result', {archive: true});
Check the written file.
ll result*
-rw-rw-rw- 1 ec2-user ec2-user 718211 Dec 20 18:04 result.zip
result:
-rw-rw-r-- 1 ec2-user ec2-user 101656 Dec 20 18:04 sample_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 141934 Dec 20 18:04 sample_2.jpg
-rw-rw-r-- 1 ec2-user ec2-user 128636 Dec 20 18:04 sample_3.jpg
-rw-rw-r-- 1 ec2-user ec2-user 384545 Dec 20 18:04 sample.jpg
Web demo added.
See here for more information.
The thumbnail write function now returns the following generated thumbnail path information.
const pdf2thumbnail = require('pdf2thumbnail');
const {thumbnailPaths, mergedPath} = await pdf2thumbnail.writeThumbnails('sample.pdf', './result');
Changelog
[1.0.2] - 2022/11/4
Changelog
[1.0.1] - 2022/11/4