Draft
feat: multi-page PDF support and real-time redaction preview#3
Conversation
Co-authored-by: ambadi565 <229596064+ambadi565@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Analyze future scope for project
feat: multi-page PDF support and real-time redaction preview
Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements two items from the project's planned future scope: processing all pages of a PDF during OCR/detection, and eliminating canvas flicker in the review modal when toggling entity masks.
Multi-page PDF support
SecureUploader.tsx— replaces the single-pagepdfDimRefwith a per-pagepdfDimsRef: Record<number, {width, height}>and iterates all PDF pages:pdfProcessor.ts—redactPDFnow acceptspageDimensions: Record<number, {width, height}>instead of a singleimageWidth/imageHeight, scaling each entity's bounding box to its own page's coordinate space.layer1.ts—mergeWordBBoxesderivespageIndexfrom the matched words' bounding boxes rather than a fixed parameter, ensuring entities are attributed to the correct page.Real-time redaction preview
ReviewModal.tsx— splits the single effect that reloaded the image on every entity toggle into two:useEffectonimageDataUrl): renders image to canvas once, storesHTMLImageElementinimgRefuseEffectonlocalEntities/scale): redraws only bounding boxes over the cached imageThis eliminates the visible flicker when toggling individual entity masks.
Pre-existing build fixes
The project had 8 TypeScript compilation errors. Resolved all to bring the build to a passing state: missing
PIITypeentries inTYPE_LABELS/TYPE_COLORS, missingmessagefield onOCRResponse, missingcanvasproperty inpdfjs-distRenderParameters, unused imports, and a PSM type mismatch in the OCR worker.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.