Skip to content

Fix for NotSupportedException if AreaBreak is inside a flex container…#39

Closed
IBaltaga wants to merge 1 commit into
itext:developfrom
IBaltaga:fix-areabreak-flex-container-div
Closed

Fix for NotSupportedException if AreaBreak is inside a flex container…#39
IBaltaga wants to merge 1 commit into
itext:developfrom
IBaltaga:fix-areabreak-flex-container-div

Conversation

@IBaltaga

@IBaltaga IBaltaga commented Jul 7, 2025

Copy link
Copy Markdown

Itext seem to not support PageBreak when rendering to pdf if we put it inside a Div with the display:flex style.
For example:

<div style="display:flex;">
    <p>Hello1</p>
    <div style="page-break-after:always"></div>
    <p>Hello2</p>
</div>

will thrown an exception because it will try to draw the AreaBreak.

Did a hotfix to be able to handle even the AreaBreak when parsing the elements inside the Flex container div.

@IBaltaga IBaltaga marked this pull request as draft July 7, 2025 09:10
@IBaltaga IBaltaga marked this pull request as ready for review July 7, 2025 09:12
@vitali-pr

Copy link
Copy Markdown
Contributor

Hi @IBaltaga , thank you for your contribution!

Would you mind signing the Contributor License Agreement and send back to us? The details are available at https://itextpdf.com/en/how-buy/legal/itext-contributor-license-agreement - it's required in order to merge the PR.

Btw, did you run tests with your changes? Are there any issues in test results?

@IBaltaga

Copy link
Copy Markdown
Author

Yes, this is the result. A lot of them are failing for ITALIAN Culture when probably expecting EN , and others because of missing Ghostscript ITEXT_GS_EXEC that i can't understand how to set
image

Soon i will provide you the Signed Contributor License Agreement

@IBaltaga

IBaltaga commented Jul 16, 2025

Copy link
Copy Markdown
Author

Hello @vitali-pr, i just send you the signed agreement to the support and cla@apryse.com email.
Let me know after you see the PR

@avlemos

avlemos commented Jul 16, 2025

Copy link
Copy Markdown

Yes, this is the result. A lot of them are failing for ITALIAN Culture when probably expecting EN , and others because of missing Ghostscript ITEXT_GS_EXEC that i can't understand how to set image

Soon i will provide you the Signed Contributor License Agreement

have you checked these instructions? https://github.com/itext/itext-dotnet/blob/develop/BUILDING.md

@IBaltaga

IBaltaga commented Jul 17, 2025

Copy link
Copy Markdown
Author

Yes, this is the result. A lot of them are failing for ITALIAN Culture when probably expecting EN , and others because of missing Ghostscript ITEXT_GS_EXEC that i can't understand how to set image
Soon i will provide you the Signed Contributor License Agreement

have you checked these instructions? https://github.com/itext/itext-dotnet/blob/develop/BUILDING.md

Hello, i checked the instructions and now i only have 37 remaining failing test.
Most of them are failing because of the culture, test methods that check error message exception with a string variable write in english
ex:
image
or wrong decimal separator also based on the culture
ex:
image
This is the final result
image

I think that if you run tests on your computer it will be ok.

@aleksf16

Copy link
Copy Markdown

Hi @IBaltaga , thank you for your contribution! Taking into account your fix, we investigated the problem in more detail and avoided the exception in a slightly different way.

@introfog

Copy link
Copy Markdown
Contributor

@IBaltaga our fix could be found here e036a28

@introfog introfog closed this Sep 23, 2025
@IBaltaga

IBaltaga commented Sep 23, 2025

Copy link
Copy Markdown
Author

@introfog as I can see the fix is to avoid throwing exception if we put page-break inside a flex container, but page-break functionality would still not be working as expected. Am i wrong?

@introfog

Copy link
Copy Markdown
Contributor

@introfog as I can see the fix is to avoid throwing exception if we put page-break inside a flex container, but page-break functionality would still not be working as expected. Am i wrong?

You are right, we have ignored AreaBreak inside flex container for now. In all the rest cases AreaBreak works as expected.

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.

5 participants