akaalias / obsidian-extract-pdf-highlights

Extract highlights, underlines and annotations from your PDFs into Obsidian
212 stars 10 forks source link

Unnecessary page rendering when extracting highlights #10

Open steven-kraft opened 3 years ago

steven-kraft commented 3 years ago

Hi, I noticed that await page.render(renderContext, annotations); gets called even if annotations.length is 0. Is there a reason for this?

I think making it so that only pages with annotations are rendered would greatly improve the time it takes to extract the highlights.

I think it depends on the PDF, but I timed that it takes about 100-200ms per page to render, making a 500 page pdf take 1-2 minutes regardless of the amount of annotations.