Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem/Bug]: Table right portion cuts within the page if table width larger than page width #4202

Closed
babithavenu opened this issue Nov 29, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@babithavenu
Copy link

babithavenu commented Nov 29, 2023

<html><head>
  <title>Large table Page</title>
<style>
table, th, td {
  border:1px solid black;
  width:100%;
}
</style></head>

<body>
<table style="width:800px !important;"><tbody><tr>
<td style="border: 0px solid rgb(255, 255, 255) !important;">XXXXXXXX</td>
<td style="border: 0px solid rgb(255, 255, 255) !important;">XXXXXXXX</td></tr></tbody></table>
</body></html>

The above is the html, that i want to convert to pdf using webview2 PrintToPdfAsync.
Here the table with width(800px) extends beyond the page and the extended portion cuts(right most portion).
The page width is 8.26 inch(~ 792px )
I want to fit the table within the page itself.

The runtime used is "Microsoft.WebView2.FixedVersionRuntime.119.0.2151.72.x64"
The framework used is .NET Framework 4.6.2
Other parameters used are
8.26 - page width
11.70 - page height
0.5 - margin top, bottom, left and right
portrait - orientation

When runtime "Microsoft.WebView2.FixedVersionRuntime.114.0.1823.86.x64" is used then the table fits within the page and working fine.

But when upgrade to version "Microsoft.WebView2.FixedVersionRuntime.119.0.2151.72.x64", this issue occurs.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

Microsoft.WebView2.FixedVersionRuntime.119.0.2151.72.x64

SDK Version

Microsoft.Web.WebView2.1.0.1938.49

Framework

WPF

Operating System

Windows 10

OS Version

No response

Repro steps

<html><head>
  <title>Large table Page</title>
<style>
table, th, td {
  border:1px solid black;
  width:100%;
}
</style></head>

<body>
<table style="width:800px !important;"><tbody><tr>
<td style="border: 0px solid rgb(255, 255, 255) !important;">XXXXXXXX</td>
<td style="border: 0px solid rgb(255, 255, 255) !important;">XXXXXXXX</td></tr></tbody></table>
</body></html>

The above is the html, that i want to convert to pdf using webview2 PrintToPdfAsync.
Here the table with width(800px) extends beyond the page and the extended portion cuts(right most portion).
The page width is 8.26 inch(~ 792px )
I want to fit the table within the page itself.

Other parameters used are
8.26 - page width
11.70 - page height
0.5 - margin top, bottom, left and right
portrait - orientation

When runtime "Microsoft.WebView2.FixedVersionRuntime.114.0.1823.86.x64" is used then the table fits within the page and working fine.

But when upgrade to version "Microsoft.WebView2.FixedVersionRuntime.119.0.2151.72.x64", this issue occurs.
The framework used is .NET Framework 4.6.2
SDK Microsoft.Web.WebView2.1.0.1938.49

Repros in Edge Browser

Not Applicable

Regression

Regression in newer Runtime

Last working version (if regression)

Microsoft.WebView2.FixedVersionRuntime.114.0.1823.86.x64, Microsoft.Web.WebView2.1.0.1938.49

@babithavenu babithavenu added the bug Something isn't working label Nov 29, 2023
@vickiez
Copy link
Contributor

vickiez commented Nov 30, 2023

Hi @babithavenu, sounds like this may be the same root cause as #4082, which is fixed in 120.0.2184.0+.

Can you try out a preview channel to see if the issue is resolved for you? https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/set-preview-channel

@vickiez
Copy link
Contributor

vickiez commented Feb 13, 2024

Closing this issue but feel free to reactivate if you are still seeing it

@vickiez vickiez closed this as completed Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@vickiez @babithavenu and others