IronOCR과 함께 libgdiplus 사용: 설정 가이드

This article was translated from English: Does it need improvement?
Translated
View the article in English

.NET Core는 Microsoft System.Drawing.Common NuGet 패키지를 사용하기 위해 libgdiplus를 필요로 합니다. macOS나 Linux에서 발견되지 않을 경우, 다음과 같은 예외가 발생할 수 있습니다:

  • _처리되지 않은 예외입니다. System.DllNotFoundException: 네이티브 라이브러리를 찾거나 로드할 수 없습니다. [ libgdiplus, libgdiplus.so ]
  • System.TypeInitializationException: The type initializer for 'Gdip' threw an exception, 을(를) 보신다면, 대신 우리의 .NET6에서 System.Drawing.Common 가이드를 읽어보세요.

리눅스

우분투, 데비안

Ubuntu 또는 Debian에서 필요한 라이브러리를 설치하려면 다음 명령을 실행하세요:

# Update package lists and install necessary libraries
sudo apt-get update && sudo apt-get install -y apt-utils libgdiplus libc6-dev
# Update package lists and install necessary libraries
sudo apt-get update && sudo apt-get install -y apt-utils libgdiplus libc6-dev
SHELL

Docker

Docker 이미지에 필요한 라이브러리를 포함하기 위해 Dockerfile에 다음 줄을 추가하세요:

# Update package lists and install necessary libraries in Docker container
RUN apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev

macOS

macOS에서 다음 예외가 발생하면:

_처리되지 않은 예외. System.DllNotFoundException: 네이티브 라이브러리를 찾거나 로드할 수 없습니다. [ libgdiplus, libgdiplus.dylib ]

이를 해결하려면:

  • runtime.osx.10.10-x64.CoreCompat.System.Drawing NuGet 패키지를 .NET 솔루션에 추가하여 프로젝트에 libgdiplus를 포함하십시오.
  • 또는, Homebrew를 통해 아래 명령으로 라이브러리를 수동 설치하십시오:
# Update Homebrew and install mono-libgdiplus
brew update && brew install mono-libgdiplus
# Update Homebrew and install mono-libgdiplus
brew update && brew install mono-libgdiplus
SHELL
  • 자세한 정보는 공식 .NET 문서에서 확인할 수 있습니다.
커티스 차우
기술 문서 작성자

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다.

시작할 준비 되셨나요?
Nuget 다운로드 5,525,971 | 버전: 2026.3 방금 출시되었습니다
Still Scrolling Icon

아직도 스크롤하고 계신가요?

빠른 증거를 원하시나요? PM > Install-Package IronOcr
샘플을 실행하세요 이미지가 검색 가능한 텍스트로 바뀌는 것을 확인해 보세요.