mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-10-25 11:17:28 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			476 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			476 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| 
 | |
| import { PDFPageProxy } from "pdfjs-dist/types/src/display/api.js";
 | |
| import 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;
 | |
| } |