Skip to content

fix(plugin-render): pass effective rotation to RenderLayer rendering#644

Open
lvdezhong wants to merge 1 commit into
embedpdf:mainfrom
lvdezhong:codex/fix-render-layer-rotation
Open

fix(plugin-render): pass effective rotation to RenderLayer rendering#644
lvdezhong wants to merge 1 commit into
embedpdf:mainfrom
lvdezhong:codex/fix-render-layer-rotation

Conversation

@lvdezhong

Copy link
Copy Markdown

Summary

Fix RenderLayer rendering for rotated PDF pages by passing the effective page rotation to renderPage.

Problem

The scroll/layout layer already accounts for page rotation when calculating page dimensions, but framework RenderLayer components rendered pages without passing a rotation option. For PDFs with per-page rotation metadata, the page container and rendered image could disagree, making pages appear sideways or stretched.

Changes

  • Add an optional rotation override prop to RenderLayer.
  • Default render rotation to page.rotation + document.rotation when no override is provided.
  • Pass the computed rotation into renderPage for React/Preact, Vue, and Svelte render layers.
  • Include rotation in render dependencies so pages re-render when rotation changes.
  • Keep plugin-render lint unblocked by avoiding a bare window reference 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.md
  • git diff --check
  • pnpm --filter @embedpdf/plugin-render lint
  • pnpm --filter @embedpdf/plugin-render build

Note: the build command completes successfully, while the declaration generation step still prints existing workspace type diagnostics for unresolved local packages.

@vercel

vercel Bot commented May 22, 2026

Copy link
Copy Markdown

@lvdezhong is attempting to deploy a commit to the OpenBook Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant