lfoppiano / streamlit-pdf-viewer

Streamlit PDF viewer
https://structure-vision.streamlit.app/
Apache License 2.0
62 stars 3 forks source link

When PDF page sizes vary, annotation positions are misaligned. #17

Closed t29mato closed 5 months ago

t29mato commented 5 months ago

In this document there seems to be a problem with the annotations.

image

We could ask each page heights and width as an optional argument of the main method

Originally posted by @lfoppiano in https://github.com/lfoppiano/streamlit-pdf-viewer/issues/3#issuecomment-1863793941

t29mato commented 5 months ago

https://github.com/lfoppiano/streamlit-pdf-viewer/commit/0495eeb82b3e95f0fd8796fffedfcde7582d9ba9 Fixed here. I had implemented it assuming that the page numbers for annotations start from 0, but they actually start from 1. 😓

image