Closed Avartil closed 6 years ago
Hello, I'm looking for a way to do one of this things:
add a unique ID for every div in text layer.
<div style="left=...., top=...," id="page1div1"> text </div>
or add a class for all pages to all divs in text layer
<div style="left=...., top=...," id="div1" class="page1"> text </div>
I'm using current PDF.js and viewer.html / viewer.js
I was able to add this inside of: function appendText(task, geom, styles) (inside pdf.js)
for (var i = 0; i < task._textDivs.length; i++) { textDiv.setAttribute('id', 'd'+i); }
It works, but only for 1-page pdfs. If pdf have more that 1 page, first div on first page gonna have the same ID as first div on secound page etc.
I get:
<div style="left=...., top=...," id="div1"> text </div> <div style="left=...., top=...," id="div1"> text </div> etc...
<div style="left=...., top=...," id="div1"> text </div>
I would like to know how to do that. Can you help me?
Hello, I'm looking for a way to do one of this things:
add a unique ID for every div in text layer.
<div style="left=...., top=...," id="page1div1"> text </div>
or add a class for all pages to all divs in text layer
<div style="left=...., top=...," id="div1" class="page1"> text </div>
I'm using current PDF.js and viewer.html / viewer.js
I was able to add this inside of: function appendText(task, geom, styles) (inside pdf.js)
It works, but only for 1-page pdfs. If pdf have more that 1 page, first div on first page gonna have the same ID as first div on secound page etc.
I get:
<div style="left=...., top=...," id="div1"> text </div>
<div style="left=...., top=...," id="div1"> text </div>
etc...I would like to know how to do that. Can you help me?