CHtmlView that is compatible with UltraHD

我的未来我决定 提交于 2020-06-25 05:39:46

问题


CHtmlView is not compatible with UltraHD resolutions. It is not simply down to using the correct HTML/CSS to be UltraHD aware. The print preview mechanism fails and crops the page. Many months ago Microsoft acknowledged this as an issue and has not addressed it.

My application heavily uses a CHtmlView element for displaying schedules and printing. Whilst my application is Windows based (Win32/x64) I am getting more and more users on Mac computers running Windows inside it and they all are always using UltraHD by default. As a result my application fails to function properly and the user has to reduce the resolution and adjust text scaling back to 100%.

Has anyone else encountered this issue with using UltraHD with CHtmlView print preview and got it working?

The related question is here:

How can I make this HTML / CSS file UltraHD / 4k friendly in a CHtmlView?

But I asked that ages ago and got nowhere so I am trying again.

Thank you.

Update

I provided this XSL script to the user to try with Ultra HD resolution in my program:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
  <xsl:output method="html" indent="yes" version="4.01"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
      </head>
      <body>
        <div style="width:100%; height:100%; border: thick solid #00FF00;">This is a test
        </div>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

So it uses the <meta http-equiv="X-UA-Compatible" content="IE=edge" /> code and it has made no difference. When he does a print preview:

So the problem still remains. It seems to be something to do with the Print Preview mechanism of the CHtmlView control.

Update

This is Microsoft link to this issue:

https://developercommunity.visualstudio.com/content/problem/215368/chtmlview-and-printing-on-ultrahd-computers.html

Still not resolved.

来源:https://stackoverflow.com/questions/52137889/chtmlview-that-is-compatible-with-ultrahd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!