我在winforms中使用webbrowser控件,現在發現我用css應用的背景圖像不包含在打印輸出中。如何使用WebBrowser控件打印css應用的背景圖像
有沒有辦法讓網頁瀏覽器打印顯示文檔的背景呢?
編輯: 因爲我想以編程方式做到這一點,我選擇了這個解決方案:
using Microsoft.Win32;
...
RegistryKey regKey = Registry.CurrentUser
.OpenSubKey("Software")
.OpenSubKey("Microsoft")
.OpenSubKey("Internet Explorer")
.OpenSubKey("Main");
//Get the current setting so that we can revert it after printjob
var defaultValue = regKey.GetValue("Print_Background");
regKey.SetValue("Print_Background", "yes");
//Do the printing
//Revert the registry key to the original value
regKey.SetValue("Print_Background", defaultValue);
另一種方式來處理,這可能是剛讀值,並通知用戶之前調整這個自己打印。我必須同意,像這樣調整註冊表並不是一個好的做法,所以我願意接受任何建議。
感謝您的反饋