how to read float32array extracted from pdf? #21075
Replies: 2 comments 3 replies
-
|
You can check how the array is used in: Line 1488 in ca13d00 |
Beta Was this translation helpful? Give feedback.
-
What your console is showingYou’re logging For each
So the message is: “here is numeric geometry the PDF painter is using,” not encrypted content. If you want the data in a more usable “original” formPick the level you care about:
Small code notes
If you say whether you need text, images, or exact path geometry, the next step is narrower. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
actually iam working on a pdf project using pdfjs-dist library any one hear who can make me understand that what my console output is trying to tell and how i get it in it's original form ?
code:
`const pdfjsLib =require("pdfjs-dist/legacy/build/pdf.mjs");
const express=require("express");
let app=express();
const fs =require("fs");
app.listen(8080,e=>{
console.log("conn");
});
const data=new Uint8Array(fs.readFileSync("cnr.pdf"));
const loadingTask = pdfjsLib.getDocument({data:data});
loadingTask.promise.then(async (pdf) => {
const page = await pdf.getPage(33);
let p=await page.getOperatorList();
const OPS = pdfjsLib.OPS;
console.log( OPS);
page.st
const opMap = {};
for (let key in OPS) {
opMap[OPS[key]] = key;
}
let k=0;
p.fnArray.forEach((fn,i)=>{
if(fn===91){
k++;
console.log(opMap[fn], p.argsArray[i]);
}
});
console.log("k",k);
}).catch(err=>{
console.log(err);
});`
console: closeStroke: 21 eoFill: 23 constructPath [ 21, [Float32Array(13) [0,0,841.8900146484375,1,595.2760009765625, 841.8900146484375,1, 595.2760009765625,0,1,0,0,4] ],Float32Array(4) [ 0, 0, 595.2760009765625, 841.8900146484375 ] ]
Beta Was this translation helpful? Give feedback.
All reactions