Skip to content

Conversation

@Arya-A-Nair
Copy link
Contributor

This PR closes #3494.

This change adds a 'strict' parameter to the PDFWriter class, allowing users to enable strict mode for error handling during PDF writing operations. The parameter is added to the init method with a default value of False to maintain backward compatibility.

@stefan6419846
Copy link
Collaborator

Thanks for the PR. Could you please update test_wrong_size_in_incremental_pdf accordingly which currently has a workaround for this?

@Arya-A-Nair
Copy link
Contributor Author

@stefan6419846 yeah sure, let me look into it.

@Arya-A-Nair
Copy link
Contributor Author

Arya-A-Nair commented Oct 23, 2025

@stefan6419846, are there any more changes you would like me to do?

@stefan6419846
Copy link
Collaborator

For now, this is the only place I am aware where the writer would use the strict mode and indeed the reason for opening the corresponding issue.

@Arya-A-Nair
Copy link
Contributor Author

@stefan6419846 is there any specific issue with pytest on windows, as there is file not found error. Any workaround that i need to take care of in my PR?

@stefan6419846
Copy link
Collaborator

This most likely just is a temporary network error. I am going to restart the corresponding job as soon as GitHub allows me.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.09%. Comparing base (4a613f3) to head (27d975e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3503   +/-   ##
=======================================
  Coverage   97.09%   97.09%           
=======================================
  Files          56       56           
  Lines        9679     9681    +2     
  Branches     1753     1753           
=======================================
+ Hits         9398     9400    +2     
  Misses        168      168           
  Partials      113      113           

☔ View full report in Codecov by Sentry.
📢 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.

@Arya-A-Nair
Copy link
Contributor Author

@stefan6419846 now it has passed all

@stefan6419846 stefan6419846 merged commit c6c25d8 into py-pdf:main Oct 23, 2025
27 of 28 checks passed
@Arya-A-Nair Arya-A-Nair deleted the feature/strict-mode-PdfWriter branch October 23, 2025 12:17
stefan6419846 added a commit that referenced this pull request Nov 9, 2025
## What's new

### New Features (ENH)
- Add 'strict' parameter to PDFWriter (#3503) by @Arya-A-Nair

### Bug Fixes (BUG)
- PdfWriter.append fails when there are articles being None (#3509) by @Noah-Houghton

### Documentation (DOC)
- Execute docs examples in CI (#3507) by @ievgen-kapinos

[Full Changelog](6.1.3...6.2.0)
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.

Allow strict mode for PdfWriter

2 participants