I've started using PDF.js, an excelent work, by the way.
But now I want to insert an image (from a canvas element) on the pdf page. Here's my code:
var image = myCanvas.getContext('2d').getImageData(0,0,400,300),
doc = new pdf();
doc.setProperties({
title: fileName,
author: 'VirtuaLab?',
creator: 'pdf.js'
});
doc.addPage();
data = doc.output();
But I haven't found anything about inserting images on PDF.js pages.
Maybe doc.image()
or doc.addImage
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…