fix(plugin-render): pass effective rotation to RenderLayer rendering#644
Open
lvdezhong wants to merge 1 commit into
Open
fix(plugin-render): pass effective rotation to RenderLayer rendering#644lvdezhong wants to merge 1 commit into
lvdezhong wants to merge 1 commit into
Conversation
|
@lvdezhong is attempting to deploy a commit to the OpenBook Team on Vercel. A member of the Team first needs to authorize it. |
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
Fix
RenderLayerrendering for rotated PDF pages by passing the effective page rotation torenderPage.Problem
The scroll/layout layer already accounts for page rotation when calculating page dimensions, but framework
RenderLayercomponents rendered pages without passing arotationoption. For PDFs with per-page rotation metadata, the page container and rendered image could disagree, making pages appear sideways or stretched.Changes
rotationoverride prop toRenderLayer.page.rotation + document.rotationwhen no override is provided.renderPagefor React/Preact, Vue, and Svelte render layers.windowreference in the shared render layer and marking the existing lifecycle config argument as intentionally unused.Validation
pnpm exec prettier --check packages/plugin-render/src/shared/components/render-layer.tsx packages/plugin-render/src/lib/render-plugin.ts packages/plugin-render/src/vue/components/render-layer.vue packages/plugin-render/src/svelte/components/RenderLayer.svelte .changeset/render-layer-rotation.mdgit diff --checkpnpm --filter @embedpdf/plugin-render lintpnpm --filter @embedpdf/plugin-render buildNote: the build command completes successfully, while the declaration generation step still prints existing workspace type diagnostics for unresolved local packages.