출처 : Set the system default printer as the default printer (admx.help)
Set the system default printer as the default printer
Set the system default printer as the default printer Tells Microsoft Edge to use the system default printer as the default choice in Print Preview instead of the most recently used printer. If you disable this policy or don't configure it, Print Preview u
admx.help
HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Edge\WebView2 키를 생성 한 후
REG_DWORD(32비트) 형식의 키와 값을 설정 한 후에
Key : PrintPreviewUseSystemDefaultPrinter
Value : 1
webview2 Brwoser를 이용하여 인쇄 미리 보기시에
시스템에 설정 된 프린터가 기본적으로 선택 되는 것을 확인 하였습니다.
public static void SetWebView2DefaultPrnReg()
{
string methodName = MethodBase.GetCurrentMethod().Name;
try
{
string tmpKey = @"SOFTWARE\Policies\Microsoft\Edge\WebView2";
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(tmpKey, true);
if (registryKey == null)
{
Registry.CurrentUser.CreateSubKey(tmpKey);
registryKey = Registry.CurrentUser.OpenSubKey(tmpKey, true);
}
if (registryKey != null)
registryKey.SetValue("PrintPreviewUseSystemDefaultPrinter", 1, RegistryValueKind.DWord);
}
catch (Exception exception)
{
}
}
'C# > WindowsForm' 카테고리의 다른 글
[C#] ListView Control 동적으로 Control 추가 후 Scroll 시에 위치 조정 방안 (2) | 2022.11.23 |
---|---|
HttpListener를 이용한 Simple한 Web서버 구현 예제 (0) | 2022.08.18 |
WebView2 Fixed 버젼 이용 시에 참조 부분 (0) | 2022.05.29 |
[C#] WebBrowser Control 로 인쇄 시에 Footer ,Header 제거 테스트 (0) | 2022.04.13 |
[C#] HttpWebRequest를 이용한 Multipart/form-data 파일 업로드 예제 (0) | 2020.11.16 |