C#에서 인쇄 시 복사본 수 설정 방법
문서의 여러 사본을 인쇄하는 것은 루틴 요구 사항입니다 - 원본과 복사본이 필요한 송장, 일괄로 인쇄되는 배송 라벨, 여러 부서에 배포되는 보고서 등입니다. 루프 내에서 Print()를 호출하여 각 사본에 대해 별도의 인쇄 작업을 생성하는 대신, 사본 수를 한 번 설정하고 프린터 드라이버가 단일 작업으로 중복을 처리하도록 하는 것이 올바른 접근 방식입니다.
IronPrint의 PrintSettings.NumberOfCopies 속성은 정수를 받아들이며 한 번의 작업으로 지정된 사본 수를 프린터로 보냅니다. 아래에서는 설치, 기본 사용법 및 결합 설정을 다룹니다.
- IronPrint를 NuGet을 통해 설치합니다:
Install-Package IronPrint - 파일에
using IronPrint;를 추가합니다 PrintSettings객체를 생성합니다- 원하는 수로
NumberOfCopies를 설정합니다 - 파일 경로와 함께 설정을
Printer.Print()에 전달합니다
-
1IronPrint를 NuGet Package Manager로 설치하십시오
-
2다음 코드 조각을 복사하여 실행하세요.
using IronPrint; // Print 3 copies of a PDF in one print job PrintSettings settings = new PrintSettings(); settings.NumberOfCopies = 3; Printer.Print("invoice.pdf", settings);Imports IronPrint ' Print 3 copies of a PDF in one print job Dim settings As New PrintSettings() settings.NumberOfCopies = 3 Printer.Print("invoice.pdf", settings)Imports IronPrint ' Print 3 copies of a PDF in one print job Dim settings As New PrintSettings() settings.NumberOfCopies = 3 Printer.Print("invoice.pdf", settings) -
3실제 운영 환경에서 테스트할 수 있도록 배포하세요.
오늘 프로젝트에서 IronPrint 사용을 시작해보세요 무료 체험
최소 워크플로우(5단계)
- IronPrint C# 인쇄 라이브러리 설치
PrintSettings객체 생성NumberOfCopies를 원하는 수로 설정- 설정을
Printer.Print()에 전달 - 프린터가 정확한 수의 복사본을 출력하는지 확인
조용한 인쇄의 복사본 수를 설정하는 방법은?
조용한 인쇄는 대화 상자 없이 문서를 바로 프린터로 보냅니다. 우리는 PrintSettings.NumberOfCopies를 통해 사본 수를 설정하고 설정을 Printer.Print()에 전달합니다:
using IronPrint;
// Configure the print job for 5 copies
PrintSettings settings = new PrintSettings
{
NumberOfCopies = 5
};
// Print the shipping label
Printer.Print("shipping-label.pdf", settings);using IronPrint;
// Configure the print job for 5 copies
PrintSettings settings = new PrintSettings
{
NumberOfCopies = 5
};
// Print the shipping label
Printer.Print("shipping-label.pdf", settings);Imports IronPrint
' Configure the print job for 5 copies
Dim settings As New PrintSettings With {
.NumberOfCopies = 5
}
' Print the shipping label
Printer.Print("shipping-label.pdf", settings)Imports IronPrint
' Configure the print job for 5 copies
Dim settings As New PrintSettings With {
.NumberOfCopies = 5
}
' Print the shipping label
Printer.Print("shipping-label.pdf", settings)프린터 드라이버는 하드웨어 수준에서 복사 명령을 받으며, 이는 개별 작업 다섯 개를 대기열에 두는 것보다 더 빠르고 신뢰할 수 있습니다. 이는 개별 작업이 다른 사용자의 문서와 교차될 수 있는 공유 네트워크 프린터에서 중요합니다.
명시적으로 설정되지 않는 한 PrintSettings.NumberOfCopies는 기본적으로 1가 됩니다. 양의 정수는 모두 허용되며 - 0 또는 음수값으로 설정해도 실제적 영향은 없으며 드라이버는 단일 사본으로 돌아갑니다.
복사본 수를 다른 인쇄 설정과 결합하는 방법은?
PrintSettings.NumberOfCopies는 PrintSettings의 한 속성입니다. 용지 여백, 용지 크기, 방향, DPI, 회색조 모드 및 프린터 선택과 같은 설정들과 단일 구성 객체에서 결합할 수 있습니다.
using IronPrint;
// Configure 3 copies with landscape A4 at 300 DPI
PrintSettings settings = new PrintSettings
{
NumberOfCopies = 3,
PaperSize = PaperSize.A4,
PaperOrientation = PaperOrientation.Landscape,
Dpi = 300,
PaperMargins = new Margins(15),
Grayscale = false,
PrinterName = "HP LaserJet Pro MFP M428"
};
// Print the Q4 report
Printer.Print("Q4-report.pdf", settings);using IronPrint;
// Configure 3 copies with landscape A4 at 300 DPI
PrintSettings settings = new PrintSettings
{
NumberOfCopies = 3,
PaperSize = PaperSize.A4,
PaperOrientation = PaperOrientation.Landscape,
Dpi = 300,
PaperMargins = new Margins(15),
Grayscale = false,
PrinterName = "HP LaserJet Pro MFP M428"
};
// Print the Q4 report
Printer.Print("Q4-report.pdf", settings);Imports IronPrint
' Configure 3 copies with landscape A4 at 300 DPI
Dim settings As New PrintSettings With {
.NumberOfCopies = 3,
.PaperSize = PaperSize.A4,
.PaperOrientation = PaperOrientation.Landscape,
.Dpi = 300,
.PaperMargins = New Margins(15),
.Grayscale = False,
.PrinterName = "HP LaserJet Pro MFP M428"
}
' Print the Q4 report
Printer.Print("Q4-report.pdf", settings)Imports IronPrint
' Configure 3 copies with landscape A4 at 300 DPI
Dim settings As New PrintSettings With {
.NumberOfCopies = 3,
.PaperSize = PaperSize.A4,
.PaperOrientation = PaperOrientation.Landscape,
.Dpi = 300,
.PaperMargins = New Margins(15),
.Grayscale = False,
.PrinterName = "HP LaserJet Pro MFP M428"
}
' Print the Q4 report
Printer.Print("Q4-report.pdf", settings)비동기 워크플로우를 위한 경우, 동일한 PrintSettings를 Printer.PrintAsync()에 대신 전달하세요.
복사본 수의 플랫폼 제한 사항이 있습니까?
일부 플랫폼에서는 프린터 드라이버가 PrintSettings.NumberOfCopies에 지정된 정확한 수를 재현하지 못할 수 있습니다. IronPrint 문서에는 플랫폼별 제한이 값이 무시되어 단일 사본으로 이어질 수 있다고 나와 있습니다. 이는 IronPrint 제한이 아닌 드라이버 수준의 제약입니다.
대부분의 인쇄 워크플로우의 주요 대상인 Windows 데스크톱 애플리케이션에서는 PrintSettings.NumberOfCopies가 로컬 및 네트워크 프린터 모두에 의해 신뢰성 있게 적용됩니다. 설정을 일관되게 무시하는 프린터를 만나면, Windows 프린터 속성 패널을 통해 드라이버가 편집된 다중 복사 작업을 지원하는지 확인하십시오.
내 다음 단계는 무엇인가요?
우리는 PrintSettings.NumberOfCopies를 사용하여 인쇄된 사본 수를 설정하는 방법, 무음 및 비동기 인쇄, 다른 설정과 사본 수 결합, 플랫폼별 주의 사항을 다루었습니다.
추가 읽기를 위해 이 리소스를 탐색하세요:
- 종단 간 인쇄 연습을 위한 IronPrint 튜토리얼 - 문서 인쇄.
- 인쇄 설정 방법 여백, DPI, 방향 등.
- 완전한 속성 문서를 위한 PrintSettings 클래스 API 레퍼런스.
- 모든 정적 인쇄 방법을 위한 Printer 클래스 API 레퍼런스.
무료 체험 라이선스를 받으세요 실행 환경에서 모든 기능을 테스트하거나, 배포할 준비가 되었을 때 라이선스 옵션을 확인하세요.
자주 묻는 질문
IronPrint을 사용하여 C#에서 여러 복사본을 인쇄하려면 어떻게 해야 하나요?
IronPrint을 사용하여 C#에서 여러 복사본을 인쇄하려면 PrintSettings 객체를 생성하고 NumberOfCopies 속성을 원하는 수량으로 설정하십시오. 그런 다음 이 설정을 파일 경로와 함께 Printer.Print() 메서드에 전달합니다.
IronPrint의 NumberOfCopies 속성을 사용하면 어떤 이점이 있나요?
IronPrint의 NumberOfCopies 속성을 사용하면 효율적인데, 이는 프린터 드라이버가 하나의 작업에서 복제를 관리하게 하여 각 복사본에 대해 여러 인쇄 작업을 반복할 필요가 없기 때문입니다.
IronPrint을 사용하여 무언 인쇄의 복사본 수를 설정할 수 있나요?
예, IronPrint에서 PrintSettings.NumberOfCopies를 구성하고 설정을 Printer.Print()에 전달하여 무언 인쇄의 복사본 수를 설정할 수 있습니다.
IronPrint을 사용하여 여러 인쇄 설정을 어떻게 결합하나요?
IronPrint은 NumberOfCopies, 용지 크기, 방향, DPI, 프린터 선택과 같은 여러 설정을 단일 PrintSettings 구성 객체 내에서 결합할 수 있게 합니다.
IronPrint로 복사본 수를 설정할 때 플랫폼 제한이 있나요?
예, 특정 플랫폼에서는 인쇄 드라이버 제한으로 인해 지정된 NumberOfCopies가 적용되지 않을 수 있으며, 특히 드라이버가 순서 정렬된 다중 복사 작업을 지원하지 않는 경우가 그렇습니다.
IronPrint에서 NumberOfCopies를 0 또는 음수 값으로 설정하면 어떻게 되나요?
NumberOfCopies를 0 또는 음수 값으로 설정하면 프린터 드라이버가 기본값으로 단일 복사본으로 설정되므로 실질적인 효과를 발휘하지 않습니다.
IronPrint에서 여러 복사본을 비동기로 인쇄하려면 어떻게 해야 하나요?
IronPrint에서 PrintSettings 객체를 Printer.PrintAsync() 메서드와 함께 사용하여 비동기 인쇄를 수행할 수 있습니다.
IronPrint을 사용하는 데 적합한 운영 체제는 무엇인가요?
IronPrint은 Windows 데스크톱 응용 프로그램과 잘 통합되며, 여기서 NumberOfCopies 속성은 로컬 및 네트워크 프린터에서 신뢰성 있게 지원됩니다.
내 프린터가 여러 복사본 기능을 지원하는지 어떻게 확인할 수 있나요?
프린터가 여러 복사본 기능을 지원하는지 확인하려면 Windows 프린터 속성 패널을 통해 드라이버 속성을 확인하여 순서 정렬된 다중 복사 작업 지원을 확인합니다.
IronPrint에 대한 보다 자세한 문서 및 튜토리얼은 어디에서 찾을 수 있나요?
Iron Software 웹사이트에서 IronPrint 튜토리얼과 API 레퍼런스를 통해 자세한 문서와 종단간 인쇄 과정을 탐색할 수 있습니다.
커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.