簡體   English   中英

IE9更改內容 <img> 打印時

[英]IE9 altering content of <img> when printed

我正在嘗試打印一個應該包含一些圖像(圖標)的網頁。 它們在頁面上正確顯示,並且Firefox可以很好地打印它們,但是IE破壞了它們中的大多數。

這就是IE中的打印圖標 Alt

這是怎么做的,我該如何解決?

這些圖標在JSP中循環設置:

<t:dataTable newspaperColumns="1"
    value="#{page.afterSales.leftOptionColumn}" var="row">
    <h:column>
        <h:graphicImage value="#{row.imgIsCompleted}" style="width: 16px !important;"/>
        <h:commandButton value="#{row.rowName}"></h:commandButton>
    </h:column>
</t:dataTable>

這個問題的原因對我來說是未知的,我可以說這是因為CSS太笨了。但是作為一種變通辦法,我建議您使用js提取target DOM element ,並創建一個新窗口,其中的內容不包含CSS可以使用<img>標簽產生此類問題的樣式。

我的工作:

function printCssCleanContent(){
                                var prtContent =  Ext.query('span[id*=overView]')[0]; // just the root dom node i choise to print (can be done with vanilla js or jquery or any other dom parser) 
                                var WinPrint = window.open('', '', 'left=0,top=0,width=1200,height=900,toolbar=0,scrollbars=0,status=0');
                                WinPrint.document.write(prtContent.innerHTML);
                                WinPrint.document.close();
                                WinPrint.focus();
                                WinPrint.print();
                                WinPrint.close();
                            }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM