简体   繁体   English

IE8中可打印的旋转

[英]Printable rotation in IE8

How do I print rotated content (divs) in IE8? 如何在IE8中打印旋转内容(div)? The DXImageTranform filter options do not appear to be printable. DXImageTranform过滤器选项似乎不可打印。

http://msdn.microsoft.com/en-us/library/ms533014(v=vs.85) http://msdn.microsoft.com/en-us/library/ms533014(v=vs.85)


Just to put this into context. 只是把它放到上下文中。 I'm writing a pure dom-based canvas library called simpleCanvas . 我正在编写一个名为simpleCanvas的基于dom的纯画布库。 I am desperately trying to offer rotation of text, rectangles and images in IE8 without using a VML fallback, because it's ugly and slow, and error prone . 我正在拼命尝试在IE8中提供文本,矩形和图像的旋转,而不使用VML后备,因为它很难看,而且很容易出错 A VML fallback is on my todo list as I concede that it's the only way I know how to do this in IE8 without additional tools. VML回退在我的待办事项清单上,因为我承认这是我知道如何在没有其他工具的情况下在IE8中执行此操作的唯一方法。 I'm hoping that there is some trick that I'm missing that doesn't come with a third party or server side requirement. 我希望有一些我缺少的技巧,没有第三方或服务器方面的要求。 If you have found it, a bounty is coming your way. 如果你找到它,就会有你的赏金。

This is a massive stretch but is the best idea I could come up with: 这是一个巨大的延伸,但是我能想到的最好的主意:

Explorer Canvas - https://code.google.com/p/explorercanvas/ - Implements the canvas in IE8 by abusing VML. Explorer Canvas - https://code.google.com/p/explorercanvas/ - 通过滥用VML在IE8中实现画布。

HTML2Canvas - http://html2canvas.hertzen.com/ - Can render your document onto a canvas, which can then be rotated. HTML2Canvas - http://html2canvas.hertzen.com/ - 可以将文档渲染到画布上,然后可以旋转。

Failing that, I suspect your only option is going to be to generate a rotated document server-side and give that to the client for printing. 如果做不到这一点,我怀疑你唯一的选择就是生成一个旋转的文档服务器端并将其交给客户端进行打印。

Edit: One other last ditch would be to handle the printing via Silverlight, embedding the page in a browsercontrol inside silverlight (yuck), rotating that and printing the result via SL. 编辑:另一个最后的沟渠将是通过Silverlight处理打印,将页面嵌入在silverlight(yuck)内的浏览器控件中,旋转并通过SL打印结果。

Really grasping at straws here though for anything client side in a legacy browser. 虽然在传统浏览器中的任何客户端都真的抓住了吸管。

According to Printing webpage with rotated text in Internet Explorer 9 you need to use -ms-transform too. 根据Internet Explorer 9中带有旋转文本的打印网页,您还需要使用-ms-transform。 Be sure to read the EDIT too as there is something buggy. 一定要阅读编辑,因为有一些错误。

Would https://developers.google.com/chrome/chrome-frame/ be acceptable? https://developers.google.com/chrome/chrome-frame/可以接受吗? I'm guessing not if its a LOB application, but it'd give you the features you need without taking the user out of IE8 in the strictest sense. 我猜不是它的LOB应用程序,但是它会为你提供所需的功能,而不会让用户从最严格意义上的IE8中删除。 Just another avenue to explore. 只是另一个探索的途径。

https://code.google.com/p/jqueryrotate/ - This will rotate images, it uses VML to do it in IE8. https://code.google.com/p/jqueryrotate/ - 这将旋转图像,它使用VML在IE8中执行此操作。 The caveat is that any text you wanted to rotate would have to be as an image. 需要注意的是,您要旋转的任何文本都必须是图像。

I've never used it and it would be some work but have you tried svgweb ? 我从来没有使用它,这将是一些工作,但你尝试过svgweb Basically it uses SVG if the browser supports it and Flash if it doesn't. 基本上,如果浏览器支持SVG,它会使用SVG,如果不支持,则使用Flash。 Because it's a flash object you can print it like an image once rendered. 因为它是一个flash对象,所以可以像渲染后的图像一样打印它。

Here's a few more demos of it: svgweb Demos 这里有几个演示: svgweb演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM