Repository navigation
OBJ-100 — PDF export endpoint - #35
Merged
objectgyan merged 1 commit intoMay 17, 2026
Merged
objectgyan merged 1 commit into
objectgyan merged 1 commit into
Conversation
POST /api/documents/{id}/export-pdf?version=N
- IPdfExportService (Core) orchestrates renderer + Playwright
- PdfExportService (Infrastructure) loads version, renders HTML, calls Playwright PdfAsync
- Version-defaulting: omit ?version returns MAX(version_number); falls back to live entity
- Error mapping: missing doc/version → 404; renderer/Playwright failure → 500
- Streaming: pdfBytes written directly to Response.Body; no intermediate MemoryStream
- scripts/validate-obj-100.ps1: creates fixture, calls export-pdf, asserts %PDF- magic, page count>=1, 404s
OBJ-100 M6.3 — PDF export endpoint streams Playwright output
Milestone M6 - Wave 2 Summary: implement an export endpoint at /api/documents/id/export-pdf that accepts an optional version query parameter, renders the document HTML through Playwright headless Chromium, and streams the resulting PDF back to the caller. No PDF is persisted to disk. Acceptance:
Validation:
Branch and PR: branch from main using Linear gitBranchName; target main. No commit trailers, no AI footer. |
objectgyan
added a commit
that referenced
this pull request
May 17, 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.
Summary
POST /api/documents/{id}/export-pdf?version=Nthat streams a Playwright-rendered PDFIPdfExportService(Core) +PdfExportService(Infrastructure) orchestrate: load version → render HTML → Playwright PdfAsync → stream bytes?versionis omitted; falls back to live document entity when no versions existResponse.Body— no intermediateMemoryStreamTest plan
dotnet build --configuration Release)dotnet test --configuration Release)scripts/validate-obj-100.ps1exits 0%PDF-magic bytes/Type /Pageregex on raw PDF bytes)?version=1returns PDF for that specific version