Native PDF Import & Live Sync for Image Occlusion

Is your feature request related to a problem? Please describe.

Working with large textbook PDFs is a major bottleneck. Currently, I have to manually screenshot or convert every single page into an image before importing it into Anki’s native Image Occlusion tool. This is extremely time-consuming and disrupts the flow of study.

Describe the solution you’d like

I would like a native way to import a PDF directly into the Image Occlusion workflow with the following features:

  1. Direct PDF Rendering: Open a local PDF and render the current page as an image inside the occlusion editor.

  2. Live Local Sync: Reference the local PDF file. If I add a mnemonic or annotation to the original PDF on my system, it should reflect under the existing masks in Anki.

  3. Fit to Width: An option to automatically fit the PDF page to the screen width for easier scrolling and masking of long pages.

Potential Drawbacks: Large PDF files might cause some initial loading lag if not optimized, but referencing the local file should keep the Anki collection size small.

Describe alternatives you’ve considered

I have tried manually taking screenshots (Win+Shift+S) and using external “PDF to Image” converters, but these are cumbersome (बोझिल) and do not allow for dynamic updates if the original PDF is edited.

I want that too :slight_smile:
But I understand it could be very complicated.
I even considered embedding JS into the PDF and creating something like Anki. But for now, it’s just an idea.
Another option: an add-on that converts PDFs to images. But you’re against it; you want to edit them. And that’s very complicated, since hiding is tied to a region, and that region will disappear when you change it. We can set a link to the PDF page number in HTML, but if you want to edit and delete some pages, that link will point to something else. I think you can set anchors, but I haven’t tried that.

Some people recommend trying PDF.js and rendering. But loading the CPU every time isn’t practical, and file caching might not always display changes correctly. I think there’s nothing better than getting the full page image and not messing with the PDF at all.

“Just updating my original proposal to be more precise. To clarify for anyone concerned about CPU rendering or text reflow, here is the refined workflow:”

**
Is your feature request related to a problem? Please describe.**

Working with large textbook PDFs is a major bottleneck. Currently, I have to manually screenshot or convert every single page into an image before importing it into Anki’s native Image Occlusion tool. This is extremely time-consuming and disrupts the flow of study.

Describe the solution you’d like

I would like a native way to link a local PDF directly to the Image Occlusion workflow, acting as a lightweight overlay rather than a heavy editor. The ideal features would be:

  1. Lightweight Viewer: Integrate a minimalist, highly optimized PDF renderer (similar to Sumatra PDF) strictly for viewing. This ensures the workflow remains fast and doesn’t become laggy.

  2. Metadata Coordination: When masks are drawn, Anki doesn’t alter or render a new static file. It simply saves the Page Number and the X, Y coordinates of the masks as metadata linked to that specific local PDF.

  3. Live Local Sync & Coordinate Stability: The core idea is that if I externally add a handwritten mnemonic or highlight to the original PDF using my local PDF reader, Anki simply loads the updated visual state of the file. To address concerns about text reflow: adding external surface annotations (ink or floating text boxes) does not alter the underlying text structure of the PDF. Therefore, the X, Y coordinates of Anki’s existing occlusion masks will remain perfectly aligned and relevant to the content.

  4. Auto-Scroll & Overlay: During reviews, Anki should load the lightweight PDF page, apply the masks using the saved metadata, and automatically scroll to the exact position of the active mask.

  5. Fit to Width: Automatically fit long PDF pages to the screen width for seamless scrolling and masking during card creation.

Potential Drawbacks: Minimal. By bypassing heavy CPU rendering and relying on coordinate metadata, the Anki collection size stays tiny and the performance remains fast.

Describe alternatives you’ve considered

I have tried manually taking screenshots (Win+Shift+S) and using external “PDF to Image” converters, but these are cumbersome (बोझिल / भारी) and break the dynamic link if I want to update my personal handwritten notes on the original PDF.

https://ankiweb.net/shared/info/16097657

hello, i think there is some important points I missed to mention after reading your reply I realise my mistake and I have updated my post please check again

I read about this today. The addon above is recommended. I haven’t rated it or installed it, so I can’t say whether you’ll like it or not.
Regarding the PDF: I read that JS can be dangerous and doesn’t work the same everywhere. So I decided there’s nothing better than simply receiving images. The addon is somewhere like this: https://ankiweb.net/shared/info/1660513597
Although, in my opinion, you shouldn’t give students a ready-made solution. They should highlight what they need on the sheet, create a note, and choose the key elements to hide. Once you’ve done it yourself, you’re satisfied with the result; you’ve embedded the work in your head. Then the student will remember it with greater pleasure.