我使用的是Angular 6。我必须将一个PDF转换成图像,为此,我使用了pdf2image npm包。我的PDF被转换为图像,但我无法为其设置目标路径。下面是我的代码片段。
pdf2image.convertPDF('/NodeWorkspace/uploads/photo-1533016241503.pdf',{
density : 200,
quality : 100,
outputFormat : '%s_page_%d',
outputType : 'png',
path: '/NodeWorkspace/uploads/output/'
})谢谢你的帮助。
发布于 2019-02-04 18:36:23
下面是使用Angular在pdf2image中设置目标路径的代码。
var dirPath=path.join(__dirname,'../../uploads/output/'+req.body.appNo)+'/%s_page_%d';
pdf2image.convertPDF(pt,{
density : 200,
quality : 100,
outputFormat : dirPath,
outputType : 'png'
})https://stackoverflow.com/questions/51606786
复制相似问题