Started migrating workflow controller

This commit is contained in:
Felix Kaspar
2023-11-13 00:09:12 +01:00
parent 57142381ca
commit 5ae8cb77ac
29 changed files with 96 additions and 127 deletions

View File

@@ -0,0 +1,15 @@
import { PDFPageProxy } from "pdfjs-dist/types/src/display/api.js";
import * as PDFJS from 'pdfjs-dist';
export async function getImagesOnPage(page: PDFPageProxy) {
const ops = await page.getOperatorList();
const images: any = [];
for (var j=0; j < ops.fnArray.length; j++) {
if (ops.fnArray[j] == PDFJS.OPS.paintImageXObject) {
const image = page.objs.get(ops.argsArray[j][0]);
images.push(image);
}
}
return images;
}