how to rearrange text extracted from pdf.js? #21327
CODE-WITH-CODEER
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
`let line_x=0;
let line_y=0;
let scale_x=1;
let scale_y=1;
p.fnArray.forEach((fn, k) => {
})

function draw_text(k, p, ctx, line_x,line_y,canv) {
let x = line_x;
let y=line_y;
let words = [];
let args = p.argsArray[k];
ctx.fillStyle = "red";
args.flat().forEach(val => {
words.push({str:val.unicode,x:x,y:y,width:val.width});
ctx.fillText(val.unicode, x, y);
});
}
`
i am struggling to rearrange the text what's wrong in my plz let me know i have shared the output below were some text are mirrored?
All reactions