Merge branch 'stirling-pdf-rewrite' into version-2

This commit is contained in:
Saud Fatayerji
2023-11-08 02:11:49 +03:00
36 changed files with 22647 additions and 100 deletions

View File

@@ -0,0 +1,14 @@
import PDFJS from 'pdfjs-dist';
export async function getImagesOnPage(page) {
const ops = await page.getOperatorList();
const images = [];
for (var j=0; j < ops.fnArray.length; j++) {
if (ops.fnArray[j] == PDFJS.OPS.paintJpegXObject || ops.fnArray[j] == PDFJS.OPS.paintImageXObject) {
const image = page.objs.get(ops.argsArray[j][0]);
images.push(image);
}
}
return images;
}