Repository navigation
feat: add in-app PDF preview - #202
Merged
Merged
Conversation
Render PDF pages with Windows.Data.Pdf off the UI thread in a new Infrastructure.Media project: one page at a time, pixels only, with a content signature check, size/page/render-size limits and a timeout. Pages and zoom follow the image preview controls; password-protected PDFs ask on the masked on-screen keyboard. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nextestudios
force-pushed
the
feature/59-pdf-preview
branch
from
September 27, 2026 22:22
966facc to
b948942
Compare
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.
Summary
.pdf(or North → Visualizar PDF) opens an in-app PDF preview. LB/RB and Left/Right change pages (only the available direction is prompted), RT/LT zoom, D-pad pans while zoomed, South fits, East/B closes with focus back on the file. Header shows "página N de M" and the zoom. Prompt fading from enhancement: make image preview controller shortcuts more visible #171 applies here too (sharedZoomablePreviewModalbase for image and PDF).ControlFS.Infrastructure.Mediaproject (net10.0-windows10.0.19041.0, no packages) withWindowsPdfRenderer:Windows.Data.Pdfrenders one page at a time to BGRA pixels on the thread pool; pixels only (no links, attachments, forms, scripts; nothing handed to another program). The file stays open shared (read/write/delete) and is closed after an in-flight render when the preview closes.PdfPreviewPolicy,PreviewLimits):%PDF-signature within the first 1 KB (a renamed executable never reaches the renderer), 200 MB, 5,000 browsable pages, pages rendered at max 3072 px, 20 s timeout for open/render (a hanging PDF becomes an error). Notes indocs/security-model.md.mp-pdf-previewcapture rendering page 2 of a generated A4 PDF with the real renderer.ControlFS.WindowsIntegrationTestsnow targetsnet10.0-windows10.0.19041.0so it can exercise WinRT APIs (lock file updated).Tested in CI
PdfPreviewJourneyTests(fake renderer): paging/bounds/zoom/pan/close releases the document; a renamed executable is refused before the renderer; password flow with wrong + right password on the masked keyboard; a hanging renderer becomes an error within the time limit.PdfRendererIntegrationTests(realWindows.Data.Pdf): renders page 1 of a generated two-page PDF with the right size and pixels, page 2 in portrait, and the file can be deleted after dispose.Manual checks (docs/TESTING.md, "Visualização de PDF (#59)")
Closes #59
🤖 Generated with Claude Code