C#에서 인쇄DPI설정 방법

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

DPI(인치당 점 수)는 인쇄 해상도를 제어합니다 — 프린터가 인쇄 용지에 배치하는 잉크 점의 수입니다. 높은 DPI는 선명한 텍스트와 매끄러운 이미지를 제공하지만, 처리 시간과 토너 사용량이 증가합니다. 낮은 DPI는 더 빠르게 인쇄되며, 내부 초안에 적합합니다. 프로그래밍적으로 DPI를 설정하면, 사용자의 기본 프린터 설정에 상관없이 모든 인쇄 작업이 애플리케이션에서 요구하는 품질 수준을 충족하도록 보장합니다.

IronPrint는 Dpi 클래스에서 PrintSettings 속성을 제공합니다. 이를 정수 값으로 설정하고 설정을 Printer.Print()에 전달하면 문서가 지정된 해상도로 PRINT됩니다. 기본값은 300 DPI이며, 이는 상업용 인쇄의 표준입니다.

빠른 시작: 인쇄DPI설정

  1. NuGet을 통해 IronPrint 설치: Install-Package IronPrint
  2. 파일에 using IronPrint;를 추가하십시오
  3. PrintSettings 객체 생성
  4. Dpi을 원하는 해상도(예: 300, 600, 1200)로 설정하십시오.
  5. 설정을 Printer.Print() 또는 Printer.ShowPrintDialog()로 전달
  1. NuGet 패키지 관리자를 사용하여 https://www.nuget.org/packages/IronPrint 설치하기

    PM > Install-Package IronPrint
  2. 다음 코드 조각을 복사하여 실행하세요.

    using IronPrint;
    
    // Print a PDF at 600DPIfor high-quality output
    Printer.Print("report.pdf", new PrintSettings
    {
        Dpi = 600
    });
  3. 실제 운영 환경에서 테스트할 수 있도록 배포하세요.

    무료 체험판으로 오늘 프로젝트에서 IronPrint 사용 시작하기

    arrow pointer

C#에서 인쇄 DPI를 설정하는 방법은?

Dpi 속성은 PrintSettings 대해 양의 정수 값을 모두 허용합니다. 기본값은 300이며, 이는 비즈니스 문서의 표준 해상도입니다. 인쇄에 사용되는 실제 DPI는 물리적 프린터의 기능에 제한될 수 있습니다. 프린터가 최대 600 DPI에서 작동할 때 1200 DPI를 설정하면 프린터는 지원되는 최고 해상도를 사용합니다.

:path=/static-assets/print/content-code-examples/how-to/set-the-dpi/set-the-dpi-office-and-high-res-dpi.cs
using IronPrint;

// Configure 300 DPI for standard office quality
var officeSettings = new PrintSettings
{
    Dpi = 300
};

// Print the invoice
Printer.Print("invoice.pdf", officeSettings);
Imports IronPrint

' Configure 300 DPI for standard office quality
Dim officeSettings As New PrintSettings With {
    .Dpi = 300
}

' Print the invoice
Printer.Print("invoice.pdf", officeSettings)
$vbLabelText   $csharpLabel

기본 .NET 환경에서는 PRINT 해상도를 제어하려면 PrintDocument을 생성하고, DefaultPageSettings.PrinterResolution에 액세스하며, PrintPage 이벤트를 처리하고, Graphics.DrawImage()을 사용하여 콘텐츠를 수동으로 렌더링해야 합니다. 이는 15-25줄의 상용구 코드를 수반합니다. IronPrint는 이를 설정 객체의 단일 정수 속성으로 줄여줍니다.

다른 인쇄 작업에 어떤 DPI를 사용해야 합니까?

올바른 DPI를 선택하는 것은 콘텐츠 유형과 목적에 달려 있습니다. 해상도가 항상 높다고 좋은 것은 아닙니다 — 텍스트가 많은 문서에는 눈에 띄는 이점 없이 스풀 크기와 인쇄 시간이 증가합니다.

DPI 최적 대상 노트
72–150 내부 초안, 증명서, 테스트 인쇄 빠른 출력, 낮은 토너 사용량
300 비즈니스 문서, 청구서, 보고서 IronPrint 기본값; standard commercial quality
600 마케팅 자료, 그래픽, 차트 눈에 띄게 선명한 이미지와 세밀한 라인
1200+ 사진, 아카이브, 미술작품 호환 가능한 프린터 필요; large spool files

대부분의 응용 프로그램에서는 300 DPI가 품질과 성능 간의 최적의 균형을 제공합니다. 우리는 기본값으로 시작하고, 이미지의 선명도나 세부 사항의 가시적 향상이 필요할 때만 올리는 것을 권장합니다.

DPI를 다른 인쇄 설정과 함께 결합하는 방법은?

DPI는 다른 PrintSettings 속성과 함께 작동하여 완전한 PRINT 작업을 정의합니다. 같은 객체에서 용지 크기, 방향, 여백, 복사 수, 그레이스케일 모드를 구성할 수 있습니다.

:path=/static-assets/print/content-code-examples/how-to/set-the-dpi/set-the-dpi-combine-dpi-with-settings.cs
using IronPrint;

// Combine 600 DPI with landscape A4 and grayscale output
var settings = new PrintSettings
{
    Dpi = 600,
    PaperSize = PaperSize.A4,
    PaperOrientation = PaperOrientation.Landscape,
    PaperMargins = new Margins(10, 10, 10, 10),
    NumberOfCopies = 2,
    Grayscale = true
};

// Print the dashboard
Printer.Print("quarterly-dashboard.pdf", settings);
Imports IronPrint

' Combine 600 DPI with landscape A4 and grayscale output
Dim settings As New PrintSettings With {
    .Dpi = 600,
    .PaperSize = PaperSize.A4,
    .PaperOrientation = PaperOrientation.Landscape,
    .PaperMargins = New Margins(10, 10, 10, 10),
    .NumberOfCopies = 2,
    .Grayscale = True
}

' Print the dashboard
Printer.Print("quarterly-dashboard.pdf", settings)
$vbLabelText   $csharpLabel

Grayscale = true을 600 DPI로 설정하면 차트나 데이터 표에 이상적인 선명한 흑백 출력을 얻을 수 있습니다. PaperMargins 값은 밀리미터 단위입니다.

사용자가 인쇄 대화 상자에서 DPI를 조정할 수 있게 하려면 어떻게 해야 합니까?

PrintSettingsPrinter.ShowPrintDialog()로 전달하면, 사전 설정된 DPI로 대화 상자가 열립니다. 사용자는 이를 수락하거나 인쇄하기 전에 해상도를 조정할 수 있습니다.

:path=/static-assets/print/content-code-examples/how-to/set-the-dpi/set-the-dpi-dialog-with-dpi-preset.cs
using IronPrint;

// Pre-configure 600 DPI for the dialog
var settings = new PrintSettings
{
    Dpi = 600,
    PaperSize = PaperSize.Letter
};

// Open the dialog with pre-selected DPI
Printer.ShowPrintDialog("design-proof.pdf", settings);
Imports IronPrint

' Pre-configure 600 DPI for the dialog
Dim settings As New PrintSettings With {
    .Dpi = 600,
    .PaperSize = PaperSize.Letter
}

' Open the dialog with pre-selected DPI
Printer.ShowPrintDialog("design-proof.pdf", settings)
$vbLabelText   $csharpLabel

비블로킹 UI 시나리오의 경우, Printer.ShowPrintDialogAsync()은 동일한 매개변수를 받아들이며 애플리케이션의 응답성을 유지합니다. 이 대화 상자를 통해 사용자는 인쇄 전에 프린터가 지원하는 해상도와 DPI를 비교하여 확인할 수 있습니다. 이는 600DPI사무용 Razor 프린터와 1200DPI포토 프린터 사이를 전환할 때 유용합니다. 사용자 개입이 필요 없는 완전 자동화된 워크플로의 경우, 대신 Printer.Print()을 사용하여 무음 인쇄를 수행하십시오.

다음 단계

DPI는 PrintSettings 객체의 단일 정수 값입니다. 각 PRINT 작업의 품질 요구 사항에 맞게 이 값을 설정하십시오. 비즈니스 문서의 경우 300으로 시작하고 그래픽 사용량이 많은 출력에는 600 이상으로 증가시키세요.

모든 사용 가능한 속성에 대한 인쇄 설정 방법, 전체 메서드를 참조한 Printer 클래스 API 참조 및 실행 가능한 코드 조각을 위한 코드 예제 페이지를 탐색하세요. IronPrint 튜토리얼은 전체 인쇄 수명주기를 안내하고, 변경로그는 최근 업데이트를 추적합니다.

실제 프로젝트에서DPI설정을 테스트하기 위해 무료 30일 체험판을 시작하세요. 준비가 되면 $999부터 시작되는 라이선스 옵션을 확인하십시오.

자주 묻는 질문

인쇄에서 DPI는 무엇입니까?

DPI는 Dots Per Inch의 약자로, 인쇄된 문서의 해상도를 의미합니다. DPI 설정이 높을수록 고품질의 인쇄물을 얻을 수 있습니다.

IronPrint를 사용하여 인쇄 DPI를 설정하는 방법은?

IronPrint에서 PrintSettings.Dpi 속성을 구성하여 인쇄 DPI를 설정할 수 있습니다. 기본값은 300 DPI지만, 특정 인쇄 작업 요구 사항에 따라 조정할 수 있습니다.

IronPrint의 기본 DPI 설정은 무엇입니까?

IronPrint의 기본 DPI 설정은 300 DPI로, 대부분의 표준 인쇄 작업에 적합합니다.

DPI 설정을 조정해야 하는 이유는 무엇입니까?

DPI 설정을 조정하면 인쇄된 문서의 해상도와 품질을 제어할 수 있습니다. 더 높은 품질의 인쇄물을 얻으려면 DPI를 높일 수 있으며, 초안이나 세부사항이 덜 중요한 인쇄물에 대해서는 낮은 DPI 설정을 사용할 수 있습니다.

각기 다른 인쇄 작업에 대해 다른 DPI를 설정할 수 있습니까?

네, IronPrint는 각기 다른 인쇄 작업에 대해 DPI를 조정할 수 있어 다양한 인쇄 요구 사항에 유연하게 대응할 수 있습니다.

IronPrint에서 아주 높은 DPI를 설정하면 어떻게 됩니까?

아주 높은 DPI를 설정하면 인쇄 품질이 향상될 수 있지만, 파일 크기가 커지고 처리 시간이 길어질 수 있습니다. 원하시는 품질과 성능 요구사항에 따라 DPI 설정을 균형있게 유지하는 것이 중요합니다.

IronPrint를 사용하여 고해상도 이미지를 인쇄할 수 있습니까?

네, IronPrint는 DPI 설정을 조정하여 고해상도 이미지를 인쇄할 수 있어, 이미지가 원하는 선명도와 세부사항으로 인쇄될 수 있습니다.

DPI 설정 변경이 인쇄 작업의 파일 크기에 영향을 미칩니까?

네, DPI를 높이면 더 높은 해상도 인쇄물을 렌더링하기 위해 더 많은 데이터가 필요하므로 파일 크기가 커질 수 있습니다. 인쇄 품질과 파일 크기 사이의 균형을 고려하는 것이 중요합니다.

표준 문서에 권장되는 DPI 설정은 무엇인가요?

표준 문서의 경우, 300 DPI 설정이 일반적으로 권장됩니다. 이는 인쇄 품질과 성능의 균형을 잘 맞춥니다.

IronPrint는 인쇄 품질 관리를 어떻게 도와주나요?

IronPrint는 DPI와 같은 인쇄 설정을 구성할 수 있는 도구를 제공하여 사용자들이 특정 요구에 맞춰 인쇄 문서의 해상도와 품질을 맞춤 설정할 수 있도록 합니다.

A PHP Error was encountered

Severity: Warning

Message: Illegal string offset 'name'

Filename: sections/author_component.php

Line Number: 18

Backtrace:

File: /var/www/ironpdf.com/application/views/main/sections/author_component.php
Line: 18
Function: _error_handler

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 63
Function: view

File: /var/www/ironpdf.com/application/views/products/sections/three_column_docs_page_structure.php
Line: 64
Function: main_view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 88
Function: view

File: /var/www/ironpdf.com/application/views/products/how-to/index.php
Line: 2
Function: view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 88
Function: view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 552
Function: view

File: /var/www/ironpdf.com/application/controllers/Products/Howto.php
Line: 31
Function: render_products_view

File: /var/www/ironpdf.com/index.php
Line: 292
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Illegal string offset 'title'

Filename: sections/author_component.php

Line Number: 38

Backtrace:

File: /var/www/ironpdf.com/application/views/main/sections/author_component.php
Line: 38
Function: _error_handler

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 63
Function: view

File: /var/www/ironpdf.com/application/views/products/sections/three_column_docs_page_structure.php
Line: 64
Function: main_view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 88
Function: view

File: /var/www/ironpdf.com/application/views/products/how-to/index.php
Line: 2
Function: view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 88
Function: view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 552
Function: view

File: /var/www/ironpdf.com/application/controllers/Products/Howto.php
Line: 31
Function: render_products_view

File: /var/www/ironpdf.com/index.php
Line: 292
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Illegal string offset 'comment'

Filename: sections/author_component.php

Line Number: 48

Backtrace:

File: /var/www/ironpdf.com/application/views/main/sections/author_component.php
Line: 48
Function: _error_handler

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 63
Function: view

File: /var/www/ironpdf.com/application/views/products/sections/three_column_docs_page_structure.php
Line: 64
Function: main_view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 88
Function: view

File: /var/www/ironpdf.com/application/views/products/how-to/index.php
Line: 2
Function: view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 88
Function: view

File: /var/www/ironpdf.com/application/libraries/Render.php
Line: 552
Function: view

File: /var/www/ironpdf.com/application/controllers/Products/Howto.php
Line: 31
Function: render_products_view

File: /var/www/ironpdf.com/index.php
Line: 292
Function: require_once

시작할 준비 되셨나요?
Nuget 다운로드 41,154 | 버전: 2026.5 just released
Still Scrolling Icon

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

빠른 증거를 원하시나요? PM > Install-Package IronPrint
샘플을 실행하세요 문서가 프린터로 전송되는 것을 지켜보세요.