0

I am developing a desktop application in Windows Forms-C#. This has a report which is shown using WebBrowser control. I have generated a Report in HTML format. The report has 2 pages, Page 1-TnC and Page 2-Annexure. I have used "page-break-after" to add page-break forcefully.

<style> 
.forcedbreak {page-break-before: always;}
</style>
</head>
<body>
<div>
<div class="forcedbreak">
</div
><div id="pg2">

When output of report is displayed in Web browser, the page-break is not shown. If I use the as same HTML string and store as a HTML page and open in IE the page-break is displayed as expected. If I render the same HTML string as PDF, the PDF is also showing page-break as expected. The same HTML is not rendered properly in WebBrowser control of Winform.

Can anyone help me about WebBrowser Control?

I have referred to this post also. Can I force a page break in HTML printing?

  • [How can I get the WebBrowser control to show modern contents?](https://stackoverflow.com/a/38514446/7444103) -- Extended features: [Web browser control emulation issue (FEATURE_BROWSER_EMULATION)](https://stackoverflow.com/a/28626667/7444103) – Jimi Oct 06 '20 at 08:58
  • @Jimi, thanks! this method of FEATURE_BROWSER Worked at my end (Developer end), I have to check at the client's end.. While I have I experienced, while setting values in registry through Application gives wrong signals to Anti-Virus software. The anti-virus raises warning message about the application. – Vidyesh Kulkarni Oct 06 '20 at 09:34
  • An Anti-Virus raises warnings for a Registry setting in the `CURRENT-USER` branch in relation to a Key that has no special restrictions? Do you have the same warnings setting a Key value in other sections of the Registry? If you open that Key, you'll probably find other applications registered there, for example Acrobat Reader, Fiddler etc. – Jimi Oct 06 '20 at 09:44

0 Answers0