streamlit-pdf-viewer icon indicating copy to clipboard operation
streamlit-pdf-viewer copied to clipboard

Enable text content

Open lfoppiano opened this issue 1 year ago • 1 comments
trafficstars

This PR enable the textlayer on top of the canvases, with the text layer it's possible to select the text extracted from the PDF (#16). Since the annotations are placed on top of the text layer, when they are very dense, it might be possible that annotations boxes and selection interfere.

This PR also update pdf.js to version 4 (#36) which fixes some vulnerabilities.

image

More information on this PR, in the related issue #16

lfoppiano avatar May 22 '24 09:05 lfoppiano

@t29mato two more questions for you:

  1. should we add a flag to disable the text layers so that user may disable them if they don't need and/or if they are not happy with their interference with the annotations?
  2. do you have any suggestion on the z-index I hardcoded, please do let me know.

lfoppiano avatar May 25 '24 00:05 lfoppiano

  1. In the latest code, it's not the text layer but the annotations that interfere with text layer selection. So, I think a button to disable annotations might be a good idea. Another idea could be to have a copy menu appear when clicking on annotations, but since annotations don't have text information, that might be tricky.
  2. I think it's fine to leave the hardcoded z-index as it is.

t29mato avatar May 27 '24 07:05 t29mato