Skip to content

BUG: Check the value assigned to print_scaling - #4011

Merged
stefan6419846 merged 1 commit into
py-pdf:mainfrom
RavSinghChandan:validate-print-scaling
Aug 26, 2026
Merged

stefan6419846 merged 1 commit into
py-pdf:mainfrom
RavSinghChandan:validate-print-scaling

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

/PrintScaling is declared with an empty list of acceptable values:

cls.print_scaling = _add_prop_name("/PrintScaling", [], None)

So any name is written through unchecked, and the generated docstring reads "Acceptable values: []".

The spec allows /None and /AppDefault, which is what docs/user/viewer-preferences.md shows. direction and duplex beside it are declared with their values and reject anything else.

Reverting the change fails the three new tests

@codecov

codecov Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.00%. Comparing base (29f389c) to head (6c95c1b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4011   +/-   ##
=======================================
  Coverage   98.00%   98.00%           
=======================================
  Files          57       57           
  Lines       11120    11120           
  Branches     2084     2084           
=======================================
  Hits        10898    10898           
  Misses        124      124           
  Partials       98       98           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan6419846 stefan6419846 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you please check and resolve the merge conflict?

/PrintScaling was declared with an empty list of acceptable values, so any
name was written through and the generated docstring read 'Acceptable values:
[]'. The spec allows /None and /AppDefault, which is what the viewer
preferences documentation shows.

direction and duplex beside it are declared with their values and reject
anything else.
@RavSinghChandan

Copy link
Copy Markdown
Contributor Author

Rebased onto main. The conflict was just my tests landing at the end of the same file as the ones from #4010, so both are there now.

@stefan6419846
stefan6419846 merged commit e1abeb0 into py-pdf:main Aug 26, 2026
29 of 34 checks passed
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