.NET Framework 설정
Web.config 구성
web.config 파일에 HttpHandler를 등록합니다.
<httpHandlers>
<add verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</httpHandlers><handlers>
<add name="DocImage" verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</handlers>라이선스 추가
Doconut는 루트 폴더에서 라이선스를 자동으로 감지하거나 수동으로 추가할 수 있습니다.
var licenseFilePath = Server.MapPath("~/Doconut.Viewer.lic");
var docViewer = new Viewer(licenseFilePath);web.config 구성
다음 구성 항목은 Doconut 및 .NET Framework와의 호환성을 보장하기 위해 web.config 파일에 필요합니다.
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="8.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MessagePack" publicKeyToken="9c7f9b36b37eaddf" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.140.0" newVersion="2.5.140.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>필수 NuGet 패키지
프로젝트가 Doconut 및 .NET Framework와 완전히 호환되도록 하려면 다음 NuGet 패키지를 포함해야 합니다:
- MessagePack - Version 2.5.140
- MessagePack.Annotations - Version 2.5.140
- Microsoft.Bcl.AsyncInterfaces - Version 8.0.0
- Microsoft.NET.StringTools - Version 17.6.3
- System.Collections.Immutable - Version 6.0.0
- System.Drawing.Common - Version 6.0.0
- System.Memory - Version 4.5.5
- System.Reflection.Emit - Version 4.7.0
- System.Reflection.Emit.Lightweight - Version 4.7.0
- System.Security.Cryptography.Pkcs - Version 8.0.0
- System.Text.Encoding.CodePages - Version 8.0.0
- System.Text.Encodings.Web - Version 8.0.0
- System.Text.Json - Version 8.0.3
렌더링 구성 옵션
다음 옵션을 사용하여 렌더링 동작을 구성할 수 있습니다:
- CadConfig: DWG, DXF 및 DGN 파일에 사용됩니다.
- EmailConfig: EML, EMLX 및 MSG 파일에 사용됩니다.
- EpubConfig: EPUB 파일에 사용됩니다.
- ExcelConfig: Excel 및 CSV 파일에 사용됩니다.
- MhtConfig: MHT 파일에 사용됩니다.
- PptConfig: PowerPoint 파일에 사용됩니다.
- ProjectConfig: MPP 파일에 사용됩니다.
- PsdConfig: PSD 파일에 사용됩니다.
- TxtConfig: TXT 파일에 사용됩니다.
- TiffConfig: TIFF 파일에 사용됩니다.
var config = new CadConfig { DefaultRender = false }; // or trueWord 문서의 사용자 정의 글꼴
WordConfig 클래스의 FontFolders 속성은 애플리케이션이 글꼴을 검색할 사용자 정의 디렉터리를 지정합니다.
var config = new WordConfig
{
FontFolders = new string[] { "C:\\CustomFonts", "D:\\SharedFonts" }
};NuGet 패키지의 AjaxControlToolkit 업데이트
호환성을 개선하기 위해 NuGet 패키지를 변경했습니다. AjaxControlToolkit은 더 이상 포함되지 않습니다. 사용자는 프로젝트에 AjaxControlToolkit 버전 4.1.50508을 수동으로 설치하시기 바랍니다.
Doconut 25.2.0에 대한 중요한 업데이트
모든 프로젝트에서 System.Text.Json 패키지를 버전 8.0.5로 업데이트하는 것이 필수입니다.
이메일 인코딩
EmailConfig 클래스의 EmailEncoding 속성은 이메일 제목과 본문에 대한 선호 인코딩을 지정합니다.
var emailConfig = new EmailConfig {
EmailEncoding = Encoding.UTF8 // Set preferred email encoding
};제목 및 본문 인코딩
EmailConfig 클래스의 SubjectEncoding 및 BodyEncoding 속성은 각각 이메일 제목과 본문에 사용되는 인코딩을 정의합니다.
var emailConfig = new EmailConfig {
SubjectEncoding = Encoding.UTF8, // Set encoding for the subject
BodyEncoding = Encoding.UTF8 // Set encoding for the body
};Word 뷰어 문화권 지원
WordConfig 클래스의 DocumentCulture 속성을 사용하면 DOC 및 DOCX 파일에 대한 문화권을 명시적으로 정의할 수 있습니다. 이를 통해 날짜, 통화, 숫자와 같은 현지화된 콘텐츠가 Microsoft Word와 동일하게 정확히 표시됩니다. 특정 형식 요구 사항이 있는 언어에 특히 유용합니다.
var config = new WordConfig { DocumentCulture = "he-IL" }; // Hebrew (Israel)
var config = new WordConfig { DocumentCulture = "ar-SA" }; // Arabic (Saudi Arabia)
var config = new WordConfig { DocumentCulture = "th-TH" }; // Thai (Thailand)
var config = new WordConfig { DocumentCulture = "ja-JP" }; // Japanese (Japan)