initial implementation of note attachments

This commit is contained in:
zadam
2023-01-22 23:36:05 +01:00
parent 6a6ae359b6
commit 339d8a7378
20 changed files with 2447 additions and 233 deletions

View File

@@ -31,6 +31,22 @@ function updateFile(req) {
note.setLabel('originalFileName', file.originalname);
if (note.mime === 'application/pdf') {
const pdfjsLib = require("pdfjs-dist");
(async () =>
{
let doc = await pdfjsLib.getDocument({data: file.buffer}).promise;
let page1 = await doc.getPage(1);
let content = await page1.getTextContent();
let strings = content.items.map(function (item) {
return item.str;
});
console.log(strings);
})();
}
return {
uploaded: true
};