Skip to content

Add auto Orientation option to preserve custom page dimensions#3977

Open
dsolankii wants to merge 1 commit intoparallax:masterfrom
dsolankii:fix/auto-orientation-page-dimensions
Open

Add auto Orientation option to preserve custom page dimensions#3977
dsolankii wants to merge 1 commit intoparallax:masterfrom
dsolankii:fix/auto-orientation-page-dimensions

Conversation

@dsolankii
Copy link
Copy Markdown

@dsolankii dsolankii commented Apr 16, 2026

Fixes #3969

What changed

  • Added autoOrientation option to jsPDF constructor (default true).
  • Kept backward-compatible behavior by default.
  • If autoOrientation: false, orientation-based dimension swapping is skipped.
  • Updated TypeScript typings (jsPDFOptions.autoOrientation?: boolean).
  • Added unit tests:
    • keeps custom page dimensions when autoOrientation is disabled
    • keeps addPage dimensions when autoOrientation is disabled

Files touched

  • src/jspdf.js
  • types/index.d.ts
  • test/specs/jspdf.unit.spec.js

@dsolankii
Copy link
Copy Markdown
Author

Hi @HackbrettXXX @MrRio , I’ve pushed the changes for issue #3969.

This PR adds the auto Orientation option to preserve custom page dimensions and includes the related tests and typings update.

Could you please review it when you have time? Thanks.

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.

Orientation changing automatically

1 participant