.NET Framework에설 설정

Web.config 구성

web.config 파일에 HttpHandler를 등록합니다.

Below IIS 7
<httpHandlers>
  <add verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</httpHandlers>
IIS 7 and above
<handlers>
  <add name="DocImage" verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</handlers>

라이선스 추가

Doconut은 루트 폴더에서 라이선스를 자동으로 감지하며, 수동으로 추가할 수도 있습니다.

Manual License Path
var licenseFilePath = Server.MapPath("~/Doconut.Viewer.lic");
var docViewer = new Viewer(licenseFilePath);

web.config 구성

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 파일에 사용됩니다.
Example usage
var config = new CadConfig { DefaultRender = false }; // or true

Word 문서의 사용자 지정 글꼴

WordConfig 클래스의 FontFolders 속성은 응용 프로그램이 글꼴을 검색할 사용자 지정 디렉터리를 지정합니다.

Usage
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 속성은 이메일의 제목과 본문에 사용할 기본 인코딩을 지정합니다.

Usage
var emailConfig = new EmailConfig {
    EmailEncoding = Encoding.UTF8 // Set preferred email encoding
};

제목 및 본문 인코딩

EmailConfig 클래스의 SubjectEncoding 및 BodyEncoding 속성은 각각 이메일 제목과 본문에 사용할 인코딩을 정의합니다.

Usage
var emailConfig = new EmailConfig {
    SubjectEncoding = Encoding.UTF8, // Set encoding for the subject
    BodyEncoding = Encoding.UTF8     // Set encoding for the body
};

Word Viewer 문화 지원

WordConfig 클래스의 DocumentCulture 속성을 사용하면 DOC 및 DOCX 파일에 대해 문화권을 명시적으로 지정할 수 있습니다. 이를 통해 날짜, 통화, 숫자와 같은 현지화된 내용이 Microsoft Word와 동일하게 표시됩니다. 특히 특정 서식 규칙이 필요한 언어에 유용합니다.

Usage
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)