πŸ“„ PDF Occlusion - import PDF, occlude, review in context of the PDF

AnkiWeb addon 549882642

Turns PDFs or single images into image-occlusion cloze decks, with a built-in mask editor and context-preserving review through page navigation and PDF scroll view.
AI-generated summary; may contain mistakes.

card-creationimportreview-flownote-managementimage-occlusion

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
15 (πŸ‘ 15 Β· πŸ‘Ž 0)
Updated
2026-07-27
Anki versions
25.09.2~
License
Not found (this does not mean that the addon has no license)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JSON
Description language
en

Maintenance

active

  • Last update or commit: 2026-07-27 (97 days before the snapshot).
  • Commits in the last year: 4.
  • Issues: 1 open, 0 closed.
  • Pull requests: 2 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
23.1025.09.2+2026-07-27
History across monthly snapshots

Loading…

Similar addons

PDF to notes has 1 fork β†’

Converts PDF pages into Anki normal or cloze notes, using each page’s first line as prompt and page images or HTML, with multiple-file, subdeck, scaling, and shortcut options.

card-creationimportcloze

9 votes 27% approval πŸ‘ 5 Β· πŸ‘Ž 4 ⭐ 6 Anki 2.1.66~ Updated 2022-07-24

Description

PDF Occlusion turns any PDF into an image-occlusion deck β€” masks grouped into cards, reviewed as proper cloze flashcards on the PDF so you always have context. Draw, group, and edit masks in a built-in editor with zoom, drag-to-move, and deck selection per PDF. Ideal for textbook chapters, lecture slides, and anatomy/histology atlases.

Demo Plugin

New Features

27-07-26

  • Filename repair: long PDF names are now shortened at import, and a new one-time migration normalises existing filenames β€” fixing pages broken by Anki's "Check Media" rename (scroll view / page navigation not loading)
  • ⇧ + draw: hold Shift while drawing to add the rectangle to the same group as the previous one
  • Portrait page fixes: single-page view scrolls inside its own viewport (no more cut-off top/bottom), cursor-anchored zoom works at every zoom level
  • Smarter focus: new questions and the βŒ‚ button centre on the active card's masks instead of the page middle
  • Peek stability: individually revealed masks stay open while zooming

21-07-26

  • Single image occlusion: import one image as a standalone occlusion note β€” via Tools β†’ PDF Occlusion β†’ Import image… or by right-clicking any image in the Add window and choosing Occlude image (respects the Add window's deck selection). Same editor, no page navigation, not part of the PDF library
  • Text annotations zoom-proof: annotation text now scales in lockstep with the page at every zoom level and is rendered identically on front and back β€” exactly the proportions set in the editor
  • Scroll view improvements: each new question re-centres on its card page and caps the zoom at page width, so you never land somewhere else in the PDF; page-scroll no longer leaks into other cards or decks
  • Per-mask peek polish: revealing a single mask on the question side now hides its hint label too
  • Import dialog fixes: correct size, no clipped text, and the currently selected deck is pre-selected

08-07-26

  • Continuous scroll view (Beta): browse the whole PDF top-to-bottom during review like a real PDF reader β€” toggle via Scroll button or S, ⌘/Ctrl + wheel zooms the PDF only (cursor-anchored, 0.2×–6Γ—), notes shown in a floating side panel
  • Text annotations: place free text on any page (mode 5/T) with size slider, colour, bold and italic β€” rendered identically on the cards
  • Per-mask labels: hints are set per rectangle instead of per group, so masks within one group can carry different labels
  • Exports fixed: page images are now officially referenced from the note, so .apkg deck exports include them
  • Transparent page fix: imports are flattened onto a white background; one-click repair with progress bar for existing images via Tools β†’ PDF Occlusion β†’ Fix transparent page borders
  • Manage PDFs upgraded: first-page thumbnails and a Due column
  • Editor improvements: segmented icon tool buttons (βœ‹ β–­ βœ₯ ⌫ T) with Draw as default, "Show note in browser" button, line breaks preserved in Notes, floating text-format panel
  • Review UI polish: "Soft Pill" navigation bar, Hide all toggle covers other masks in neutral grey, ✎ button opens the editor for the current page

19-05-26

  • Folders in Manage PDFs dialog: group PDFs into folders, subfolders via Parent::Child scheme
  • Protected against "Check Media β†’ Delete Unused": PDF page images are no longer incorrectly flagged as unused. One-time migration runs automatically on first start
  • Editor improvements: Notes field editable inline, DPI choice at import (Standard / High Resolution), shortcuts R and E for Rectangle and Edit mode
  • Reliability: robust note lookup for PDF names with special characters, left-side page preview now works consistently, editor opens without forcing a profile reload

26-04-25

  • Hide other Occlusions in Study mode
  • Bug fixes

25-04-25

  • Set labels for occlusions
  • Stabilisation of cards order inside a note after deleting a card
  • Use βŒ₯ + </> to navigate

Usage

Import a PDF

Tools β†’ PDF Occlusion β†’ Import PDF… Pick a PDF and a target deck. The editor opens automatically.

Draw masks

  • Mode 2 (Draw): drag to add a mask β€” each mask starts its own group.
  • Mode 3 (Edit): click/shift-click to select, drag to move, G to group selected, U to ungroup, Delete to remove.
  • Ctrl+S or "Save page": writes the masks and regenerates cards.

Each mask (or group) becomes one flashcard. The tooltip after saving shows N mask(s) β†’ M group(s) β†’ K active card(s).

Review

Cards show the page with the current group's masks opaque and the other masks transparent β€” you see the full context. Above the page there's a β—€ Page 5 / 30 β–Ά navigation bar, plus small peek strips of the adjacent pages on either side. Click the arrows, the page strip or just the peek strips to jump pages. Home button (βŒ‚) returns to the question page.

Manage PDFs

Tools β†’ PDF Occlusion β†’ Manage PDFs… Lists all imported PDFs with page/card counts. Per PDF:

  • Open the editor
  • Rename
  • Move all cards to a different deck
  • Delete (removes notes + media files)

Other commands

  • Open PDF viewer… β€” pick from dropdown and edit
  • Open context viewer for current card (Ctrl+Shift+P) β€” during review, open a floating side-panel synced to the current card
  • Repair note metadata β€” run the idempotent in-place migration. Use in case of a broken navigation bar
  • Migrate legacy notes… β€” one-time upgrade from the pre-0.2 type

How it's stored

A cloze note type called PDF Occlusion is created with these fields:

  • PDF Name β€” logical name (used to group pages)
  • Page Number β€” 1-based
  • Page Image β€” bare filename of the PNG
  • Occlusions β€” JSON: [{x,y,w,h,group}, ...] (normalised to 0–1)
  • Groups β€” cloze deletions, e.g. {{c1::g1::g1}}{{c2::g2::g2}}
  • Notes β€” free-form text shown on the back
  • PDF Prefix β€” filename prefix for adjacent-page navigation
  • Total Pages β€” total page count of the PDF

Card template shows each group as one cloze deletion; the JS layer renders masks from the JSON positioned as percentage overlays.

Β© C. Ritter

Buy Me A Coffee

README

PDF Occlusion β€” Anki add-on

Import a PDF, get one Anki note per page, draw image-occlusion masks, group them into cards, and review them as proper cloze flashcards with an inline page-peek and context navigation.

Version: 0.6.3 Requires: Anki 24.x or later (bundles Qt 6 with the QtPdf module).


Install

Option A β€” AnkiWeb upload (recommended, see below for how to upload).

Option B β€” Install .ankiaddon file: Drag pdf_occlusion.ankiaddon onto Anki, or: Tools β†’ Add-ons β†’ Install from file… β†’ pick the .ankiaddon.

Option C β€” Copy folder manually: Put the pdf_occlusion folder into Anki's add-ons directory:

  • macOS: ~/Library/Application Support/Anki2/addons21/pdf_occlusion/
  • Windows: %APPDATA%\Anki2\addons21\pdf_occlusion\
  • Linux: ~/.local/share/Anki2/addons21/pdf_occlusion/

Usage

Import a PDF

Tools β†’ PDF Occlusion β†’ Import PDF… Pick a PDF and a target deck. Each page is rendered to 150 DPI PNG and stored as a "PDF Occlusion" note. The editor opens automatically.

Draw masks

  • Mode 2 (Draw): drag to add a mask β€” each mask starts its own group.
  • Mode 3 (Edit): click/shift-click to select, drag to move, G to group selected, U to ungroup, Delete to remove.
  • Ctrl+S or "Save page": writes the masks and regenerates cards.

Each mask (or group) becomes one flashcard. The tooltip after saving shows N mask(s) β†’ M group(s) β†’ K active card(s).

Review

Cards show the page with the current group's masks opaque and the other masks transparent β€” you see the full context. Above the image there's a β—€ Page 5 / 30 β–Ά navigation bar, plus small peek strips of the adjacent pages on either side. Click the arrows, the page strip or just the peek strips to jump pages. βŒ‚ returns to the question page.

Manage PDFs

Tools β†’ PDF Occlusion β†’ Manage PDFs… Lists all imported PDFs with page/card counts. Per PDF:

  • Open the editor
  • Rename
  • Move all cards to a different deck
  • Delete (removes notes + media files)

Other commands

  • Open PDF viewer… β€” pick from dropdown and edit
  • Open context viewer for current card (Ctrl+Shift+P) β€” during review, open a floating side-panel synced to the current card
  • Repair note metadata β€” run the idempotent in-place migration
  • Migrate legacy notes… β€” one-time upgrade from the pre-0.2 type

How it's stored

A cloze note type called PDF Occlusion is created with these fields:

Field Contents
PDF Name Logical name (used to group pages)
Page Number 1-based
Page Image Bare filename of the PNG
Occlusions JSON: [{x,y,w,h,group}, ...] (normalised to 0–1)
Groups Cloze deletions, e.g. {{c1::g1::g1}}{{c2::g2::g2}}
Notes Free-form text shown on the back
PDF Prefix Filename prefix for adjacent-page navigation
Total Pages Total page count of the PDF

Card template shows each group as one cloze deletion; the JS layer renders masks from the JSON positioned as percentage overlays.


Notes & limits

  • Encrypted PDFs are rejected by Qt's PDF reader.
  • Render DPI is 150 by default. For very small fonts, bump RENDER_DPI in importer.py.
  • Large PDFs: each page becomes one PNG in the media folder. A 500-page PDF at 150 DPI is ~200 MB of media.
  • AnkiWeb sync: the add-on is carefully written not to touch the collection on startup unless something genuinely needs updating, so regular syncs should be conflict-free after the first launch with a new version.

Uploading to AnkiWeb

First-time upload

  1. Go to https://ankiweb.net/shared/addons/ and log in (same account as Anki's sync).
  2. Click Share a new add-on.
  3. Fill in:
    • Title: PDF Occlusion
    • Tags: pdf, occlusion, image-occlusion, study, medicine
    • Description: copy the "Usage" section above.
    • Branch: pick 2.1 or whichever Anki branch you want to target (current Anki is on the 2.1 / qt6 branch).
    • Supported Anki versions: set min point version to 231000 (Anki 23.10) to match manifest.json.
  4. Upload the pdf_occlusion.ankiaddon file.
  5. Submit β€” you'll get an add-on code (e.g. 123456789) that others use to install it.

Updating an existing upload

  1. Go to https://ankiweb.net/shared/addons/ β†’ My add-ons.
  2. Click on your add-on.
  3. Click Upload new version.
  4. Bump human_version in manifest.json (e.g. 0.6.3 β†’ 0.6.4), rebuild the .ankiaddon (see below), upload.
  5. Write a short change log in the description.

Rebuilding the .ankiaddon

If you edit any file, rebuild the package by zipping the contents of the pdf_occlusion/ folder (not the folder itself!) with a .ankiaddon extension:

cd pdf_occlusion
zip -r ../pdf_occlusion.ankiaddon . -x "*.pyc" "__pycache__/*"

On macOS/Linux this is one command. On Windows, right-click inside the folder β†’ "Send to β†’ Compressed folder", then rename .zip to .ankiaddon. The archive root must contain manifest.json, __init__.py, etc. directly β€” not inside a subfolder.

Private distribution (no AnkiWeb)

If you just want to share with a few people, send them the pdf_occlusion.ankiaddon file directly. They install via Tools β†’ Add-ons β†’ Install from file…. No account needed.