Skip to content

CODE-253: Set default PDF export canvas dimensions to standard US Let… - #7728

Open
cpstence wants to merge 2 commits into
PCGen:masterfrom
cpstence:CODE-2537-paper-type-should-default-to-letter-for-american-locale
Open

CODE-253: Set default PDF export canvas dimensions to standard US Let…#7728
cpstence wants to merge 2 commits into
PCGen:masterfrom
cpstence:CODE-2537-paper-type-should-default-to-letter-for-american-locale

Conversation

@cpstence

@cpstence cpstence commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file important? I feel, that you don’t review code after AI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A PowerShell regex replacement misfired in my terminal and generated phantom files instead of modifying Globals.java. I've nuked the garbage files and force-updated the branch so it only contains the clean XSLT/Java fixes.

@cpstence
cpstence force-pushed the CODE-2537-paper-type-should-default-to-letter-for-american-locale branch from 18f34d3 to 6a04bda Compare September 4, 2026 14:02
@cpstence

cpstence commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Issue Breakdown

The PCGen export engine was hardcoded to default to European A4 dimensions, completely ignoring the user's operating system locale settings.

An initial attempt to apply the US default using the frontend translation string "in_PaperLetter" caused the FreeMarkerExportHandler to crash with an Invalid export tag 'PAPERINFO.NAME' error, as the XML exporter requires the strict internal identifier.

Applied Fixes

Rewrote initPreferences() in Globals.java to evaluate Locale.getDefault().getCountry() dynamically, successfully assigning standard US Letter defaults for system environments set to US or CA.

Replaced the "in_PaperLetter" string with the correct "Letter" identifier across Globals.java and system\gameModes\default\paperInfo.lst to safely resolve the FreeMarker template crash.

Validated the fix locally; engine now auto-corrects corrupted preferences and correctly exports PDFs with 8.50 × 11.00 inch dimensions for American locales.

Before
image

After
image

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.

2 participants