IronPrint와 Claude Code 사용법

Curtis Chau
Curtis Chau
업데이트됨: 2026년 10월 26일

병원 실험실은 한 서비스에서 세 가지 종류의 문서를 출력합니다. 표본 라벨은 수집 데스크의 라벨 프린터로, 결과 보고서는 사무실 프린터로, 운송 서류는 발송실로 보냅니다. 라우팅 파일은 각 문서 유형에 대해 프린터 이름을 지정하며, 그 파일에 잘못된 문자가 하나만 있어도 환자 결과가 오류 없이 다른 방으로 전달될 수 있습니다. Claude Code는 Anthropic의 에이전트 코딩 도구로, 리포지토리에서 파일을 편집하고 명령을 실행합니다. 이 도구는 명령줄 도구, VS Code와 JetBrains 편집기의 확장으로, Claude 데스크탑 앱 및 claude.ai/code에서 사용할 수 있습니다.

IronPrint는 .NET에서 PDF 및 이미지를 인쇄하며, 조용히 인쇄하거나 운영 체제 대화 상자를 통해 인쇄합니다. PrintSettings.PrinterName 속성은 작업에 대해 프린터를 선택하고, Printer.GetPrinterNames은 기기에 설치된 프린터 목록을 표시합니다. 아래의 네 가지 테스트 프롬프트는 실험실을 위한 프린터 라우터를 빌드하고, 각 프롬프트에 의존하는 IronPrint 동작을 기록합니다.

빠른 시작
NuGetNuGet으로 설치

PM > Install-Package IronPrint

위 명령을 NuGet 패키지 관리자 콘솔에 입력하거나 NuGet 패키지 관리자에서 패키지를 검색하여 IronPrint를 설치하십시오.

프로젝트 폴더에서 터미널을 열고 claude를 시작하며, 첫 번째 프롬프트를 보내기 전에 /model opusplan으로 모델을 전환합니다. 경로 앞에 @을 입력하면 그 파일의 내용을 요청에 포함시킵니다.

Add the IronPrint NuGet package, version 2026.10.1, to LabPrintRouter.csproj.
Then have Program.cs check the printer names in @config/printer-routes.json.

The program does this, in order:

1. Applies the license key and prints License.IsLicensed.
2. Prints each name from Printer.GetPrinterNames on its own line, in quotes.
3. Prints each route's document type, its printer name in quotes, and installed or missing.

A route's printer counts as installed only on an exact match, case and spaces included.
Don't send any print job. Every printer on this machine opens a Save dialog.

My key is in the IRONPRINT_LICENSE_KEY environment variable.
Program.cs reads it at startup and assigns it to License.LicenseKey.
Don't print its value, and don't dump the environment to find it.
If you check the variable, a yes or no on whether it's set is enough.
Text

출력의 따옴표는 후행 공백을 보이게 만듭니다.



.NET 인쇄 프로젝트에서 Claude Code는 무엇을 하나요?

에이전트는 라우팅 파일을 읽고, 구성된 각 프린터 이름을 설치된 프린터와 비교하여 각 문서에 대한 결정을 기록하는 라우팅 서비스를 작성합니다. Claude Code는 프로그램과 그 테스트를 실행하고 그들이 보고하는 오류를 수정할 수 있습니다. 개발자는 각 문서 유형을 서비스할 프린터를 결정합니다.

첫 번째 프롬프트에 패키지 이름과 버전을 명시합니다. 슬롭스쿼팅이라는 공격에서는 공격자가 언어 모델이 환각할 수 있는 이름으로 유해한 패키지를 등록합니다. 패키지 이름을 자체적으로 선택하는 에이전트는 그러한 패키지 중 하나를 설치할 수 있습니다.

Claude Code를 어떻게 설정하나요?

설치와 첫 로그인은 Anthropic의 빠른 시작을 따릅니다. 터미널에서 claude이 세션을 열고 프롬프트에 응답하면 설정이 완료됩니다.

Claude Code가 작업할 수 있는 프로젝트를 어떻게 설정하나요?

첫 프롬프트 전에 리포지토리에 입력을 넣어둡니다. 이 가이드의 샘플 프로젝트는 net9.0-windows용 .NET 9 콘솔 앱과 네 가지 문서 유형의 라우팅 파일, 문서 유형으로 시작하는 이름의 7개의 PDF 받은 편지함을 보유하고 있습니다. 하나의 경로는 설치된 프린터의 정확한 이름을 사용합니다. 나머지 세 가지는 설치되지 않은 프린터, 다른 케이스로 된 설치된 이름, 이후에 공백이 있는 이름을 사용합니다.

Claude Code는 세션이 시작될 때 CLAUDE.md를 읽어 나중의 모든 세션에 규칙이 적용됩니다. 빠른 시작이 패키지를 추가한 후 두 번째 프롬프트가 그 파일을 작성하고 인쇄 코드를 검토하는 읽기 전용 하위 에이전트를 정의합니다.

Add a Printing section to a new CLAUDE.md at the repository root.
Later sessions should follow these rules from it:

- All printing goes through IronPrint. Add no other printing library.
- The package is IronPrint, at the version LabPrintRouter.csproj references now.
- Look up IronPrint member names in docs/IronPrint.xml.
- config/ and inbox/ are inputs. Leave them unchanged.
- The program sends no print job unless it runs with --send.
- Never run it with --send on this machine.
- Read the key from IRONPRINT_LICENSE_KEY. Never print it, save it, or dump the environment.

Copy IronPrint.xml to docs/ now, from the ironprint 2026.10.1 folder of the local NuGet cache.
Use the one under lib/net7.0-windows7.0.
If it isn't there, tell me, and still add the subagent below.

Then create a subagent at .claude/agents/printer-name-auditor.md.
Limit its tools to Read, Grep and Glob.
It reviews Services/ and returns three lists:

- IronPrint types and members in use, flagging any that docs/IronPrint.xml lacks.
- Types under IronSoftware.*, listed apart, since they ship in other assemblies.
- Every place a PrinterName gets set, and whether that name passed an exact installed check first.
Text

Claude Code는 .claude/agents를 주시하며, 새로 추가된 하위 에이전트 정의를 다시 시작하지 않고도 로드하지만, 해당 폴더가 세션 시작 시 존재했을 때만 가능합니다. 따라서 샘플 리포지토리는 세션을 열기 전에 비어 있는 .gitkeep 파일과 함께 폴더를 보유하고 있습니다. IronPrint의 llms.txt는 사용 방법 가이드, 에이전트 기술, 기타 문서를 색인화합니다.

첫 번째 인쇄 호출 전에 라이선스 키를 적용합니다. 키가 없으면 Printer.Print 및 Printer.PrintAsync이 던져지고 작업이 대기열에 추가되지 않습니다. IronPrint License Keys 페이지는 시험 키를 제공하고 코드 할당 및 설정 파일 설정을 보여줍니다.

어떤 IronPrint 프린터 규칙이 CLAUDE.md에 있어야 합니까?

우리는 IronPrint 2026.10.1에서 각 줄 뒤의 동작을 한 번 라이선스 있고 한 번 라이선스 없이 조사했습니다. 인쇄 섹션 아래 블록을 붙여넣습니다.

These printer rules come from probes on IronPrint 2026.10.1:

- PrintSettings.PrinterName must equal a Printer.GetPrinterNames() entry, character for character.
- Any other name sends the job to the Windows default printer, and nothing throws.
- That covers a missing printer, a different case, a trailing space and an empty string.
- Decide whether to print with StringComparison.Ordinal.
- A trimmed or case-blind match may label a near miss, but it never sends a job.
- Printer.GetPrinterTrays() returns an empty list for a name that isn't installed.
- An empty tray list is also normal for some real printers, so it can't test a name.
- Printer.GetPrinterNames() works without a key, so a printer list proves nothing about licensing.
- IronPrint doesn't read IRONPRINT_LICENSE_KEY by itself. Assign License.LicenseKey at startup.
- Assigning a null key doesn't throw. License.IsLicensed just stays false.
- Without a key, Printer.Print throws AggregateException with a LicensingException inside.
- Without a key, Printer.PrintAsync throws LicensingException directly.
- LicensingException is IronSoftware.Exceptions.LicensingException, internal to IronPrint.dll.
- Print and PrintAsync both wait on the driver, and a Save dialog keeps them waiting.
Markdown

두 가지 예외 모양이 오류 처리를 영향을 미칩니다. PrintAsync에서의 예외는 처리되지만 Print에서의 내부 예외는 처리되지 않습니다. 둘 다 catch (LicensingException)을 사용할 수 없는데, 이는 유형이 공개되지 않았고 그 조항이 CS0122와 함께 실패했기 때문입니다.

IronPrint가 일치하지 않는 프린터 이름을 거부합니까?

프린터 이름 지정 가이드에 따르면, 이름 비교는 대소문자를 구분하며 잘못된 이름은 조용히 실패하거나 오류를 발생시킵니다. 우리의 탐사 결과는 설치된 프린터와 일치하지 않는 4개의 이름으로 2페이지 보고서를 보냈습니다. 이름은 설치되지 않은 프린터 이름, 설치된 'Adobe PDF'에 대한 'adobe pdf', 그 뒤에 공백이 있는 설치된 이름, 그리고 빈 문자열이었습니다. 네 가지 호출 중 어느 것도 오류를 발생시키지 않았으며, 모든 작업은 실험 기계의 기본 대기열인 Microsoft Print to PDF로 전달되었습니다.

따라서 라우터는 각 구성된 이름을 인쇄 메서드를 호출하기 전에 설치된 이름과 비교해야 합니다.

IronPrint가 인쇄 작업을 어떻게 구성합니까?

IronPrint는 각 PDF 페이지를 PrintSettings.Dpi의 해상도로 이미지로 드라이버에 보냅니다. Microsoft Print to PDF에 대한 탐사 작업은 각 페이지가 텍스트 레이어가 없는 1239 x 1754 픽셀 이미지로 된 2페이지 A4 PDF를 생성했으며, 150 DPI로 렌더링되었습니다. 가이드의 샘플 출력은 기본 300 DPI에서 같은 패턴을 따르며, 각각의 A4 페이지는 2479x3508 픽셀로 되어 있습니다. 따라서 PDF 프린터의 출력을 확인하려면 페이지 수나 이미지를 비교해야 하며, 인쇄된 텍스트는 검색할 수 없습니다.

인쇄하지 않고 작업을 검사하기 위해 테스트 설정은 Windows에서 IronPrint가 사용하는 WPF 인쇄 호출을 후크했습니다. 후크는 모든 작업을 XPS 형식으로 디스크에 쓰고 아무 것도 대기열에 넣지 않으며, 저장된 페이지 이미지는 탐사 작업과 동일하게 1239 x 1754 픽셀로 측정되었습니다. IronPrint는 작업의 인쇄 티켓에 다른 설정을 기록합니다. Grayscale가 켜지면, 티켓은 단색 출력을 요청했습니다. 페이지 이미지는 RGB로 저장되고 회색 픽셀만 포함되었습니다. 티켓의 복사 수는 NumberOfCopies에서 왔으며, 작업에는 각 페이지가 한 번 있었음.

라벨 경로는 작업에 대해 대체가 어떻게 작용하는지 보여줍니다. 입력은 받은 편지함의 100 x 50 mm 라벨, specimen-label__S-031.pdf이며, PaperSize.PrinterDefault으로 300 DPI로 LAB-ZEBRA-01로 라우팅 파일이 보냅니다.

산출

라벨 경로의 설정은 이름 검증 없이 전송되어, 작업이 Microsoft Print to PDF로 되돌아갔습니다. 프린터 기본 용지 크기는 그 프린터의 A4 용지로 해결되었고, 라벨은 A4 가로 페이지의 1179 x 591 픽셀 이미지로 변환되었습니다. 작업은 그 이미지를 용지의 전체 너비인 297 x 149 mm로 크기를 조정했습니다.

IronPrint가 이름 검증 없이 작업을 빌드했을 때의 표본 라벨 S-031. 300 DPI의 A4 가로 페이지 하나가 Microsoft Print to PDF에 전송되고 프린터 대신 파일로 캡처되었습니다.

IronPrint 코드로 컴파일되는 프롬프트를 어떻게 만듭니까?

라우터와 보고서를 하나의 프롬프트로 계획 모드에서 보내고, 파일 변경 전 디자인을 합의합니다. 상태 표시줄이 계획 모드를 표시할 때까지 Shift+Tab을 눌러 그런 다음 프롬프트를 보냅니다. opusplan에서, 계획은 Opus로부터 오며, 계획이 승인되면 Sonnet이 변경을 합니다.

Build the router in Services/PrintRouter.cs and the report in Services/RoutingReport.cs.
Call both from Program.cs after the printer check.
Program.cs passes PrintRouter the list from one Printer.GetPrinterNames call.

Each PDF in inbox/ is named <documentType>__<id>.pdf.
For each file, PrintRouter does this:

1. Finds the route for its document type in config/printer-routes.json.
2. Checks the route's printer against that list.
3. Builds PrintSettings from the route's paper size, orientation, DPI, copies and grayscale.
4. Sends the job with Printer.PrintAsync, but only under --send.

Each file gets the first of these decisions that fits:

- send, when the printer name matches an installed name exactly.
- name-mismatch, when it matches one after ignoring case and outer spaces.
- not-installed, when nothing matches.
- no-route, when the config has no route for the type.

Only send files reach the print call.
Put that call behind an interface so tests can use a fake.

Write out/routing-report.csv with a header row and one row per file, sorted by file name.
Its first columns are File, DocumentType, ConfiguredPrinter, Decision and InstalledName.
Then come PaperSize, Orientation, Dpi, Copies and Grayscale from the route.
InstalledName holds the installed printer for send and the near match for name-mismatch.
It stays empty for the other two decisions.
A no-route row leaves the five route columns empty too.
Write Grayscale as true or false.
Print a count of files per decision.

Run the program without --send and show me the CSV.
Then have the printer-name-auditor subagent review Services/.
Text

프롬프트의 두 부분은 라우팅을 보호합니다.

  1. 전송 플래그: --send 없이 프로그램은 작업을 보내지 않으므로 에이전트는 다이얼로그를 여는 프린터를 가진 기계에서 라우터를 실행하고 테스트할 수 있습니다.
  2. 감사 하위 에이전트: 맞춤 하위 에이전트는 CLAUDE.md를 로드하여, 프린터 이름 규칙이 그것의 검토에도 적용되도록 합니다. 내장 에이전트 중 Explore와 Plan은 CLAUDE.md 없이 시작됩니다.
팁: 계획을 승인하기 전에, IronPrint에 주어진 이름이 정확한 검사에서 설치된 이름인지 확인합니다. 계획이 이름을 케이스 관계없이 일치시키고 구성된 이름을 전달하면 수송 서류가 기본 프린터로 보내집니다.

IronPrint 라우팅 코드를 라이센스 키 없이 테스트할 수 있습니까?

예, 테스트가 인쇄 호출을 대체하는 경우 가능합니다. 라우팅 파일 읽기, 설치된 프린터 나열 및 PrintSettings 빌딩은 키 없이도 실행되므로, 각 라우팅 결정은 키를 보유하지 않은 빌드 서버에서 테스트할 수 있습니다.

Add a LabPrintRouter.Tests xUnit project that targets net9.0-windows.
It tests PrintRouter through a fake print sink.

The tests read the copies of inbox/ and config/ in their output folder.
Give the router a fixed printer list of "Adobe PDF", "Microsoft Print to PDF" and "Fax".
Assert these results:

- The decision for each of the 7 files.
- The fake receives the 2 result reports and nothing else.
- RPT-4471 goes out with A4, Portrait, 150 DPI, 1 copy and grayscale on.
- Printer.GetPrinterNames runs without throwing while no key is applied.

Set the project up this way:

- It lives in its own folder, and the repository root gets no solution file.
- LabPrintRouter.csproj must not compile anything in that folder.
- The test output folder gets copies of config/ and inbox/.

Run dotnet test one time, in a child process that has no IRONPRINT_LICENSE_KEY.
Tell me the pass count from that run.
Text

생성된 IronPrint 코드를 신뢰하기 전에 무엇을 확인해야 합니까?

다음 검토로 생성된 IronPrint 코드를 검토합니다.

  • 빌드: IronPrint에 없는 멤버가 dotnet build을 컴파일 오류로 멈춥니다. 출시된 IronPrint.xml은 내부 PdfiumUtils 클래스의 메서드를 또한 문서화하며, 호출하는 코드는 CS0122로 실패합니다.
  • 라우팅 보고서: 처음 실질적인 작업 전에 각 결정을 라우팅 파일 및 설치된 프린터 목록과 비교합니다.
  • 프린터별 테스트 페이지 하나: 출시 전에 각 장치에서 테스트 페이지가 라우트가 지시한 곳에서 인쇄되었는지 확인합니다.

AI 코딩 지원 가이드는 고정된 통과 기준이 있는 완전한 IronPrint 작업을 반복 가능한 테스트로 제공합니다.

실제 실행에서 프롬프트가 무엇을 생성했습니까?

네 가지 프롬프트는 하나의 Claude Code 세션에서, 표시된 순서대로 실행되었습니다. 프롬프트 3 전에 규칙 블록이 CLAUDE.md에 붙여지고, 아무도 코드 수동으로 편집하지 않았습니다.

  • 빠른 시작 출력에는 설치된 모든 네 개의 프린터와 설치된 경로 하나, 누락된 세 경로가 명시되었습니다.
  • 라우팅 보고서는 7개의 파일 각각에 대한 한 줄을 포함하고 있었습니다.
  • 2개의 파일이 발송되며, 2개는 이름 불일치, 2개는 설치 안 됨, 1개는 경로 없음으로 표시되었습니다.
  • 모든 결정은 설치된 프린터에 대한 우리 독립적인 검사와 일치했습니다.
  • 근접 일치는 수송 서류에 대한 Adobe PDF와 병동 요약에 대한 Microsoft Print to PDF였습니다.
  • 새로운 복사에서 깔끔하게 릴리스 실행이 동일한 보고서를 생성했습니다.
  • 키 없이 프로그램은 IsLicensed를 False로 보고했으며, 동일한 7개의 결정을 내렸습니다.
  • IRONPRINT_LICENSE_KEY 변수를 사용하지 않고 10개 중 10개의 테스트가 통과했습니다.
  • 하위 에이전트는 IronPrint.xml에서 누락된 IronPrint 멤버를 찾지 않았으며,
  • 정확히 검사 후 배치된 프린터 이름 할당 하나를 찾았습니다.
  • 실행 후 인쇄 대기열은 비어 있었고, 대본의 어느 명령도 --send를 사용하지 않았습니다.
  • 두 개의 발송 작업 캡처는 Adobe PDF 대기열에서 각각 1239 x 1754 픽셀 이미지인 3개의 A4 세로 페이지를 포함했습니다.
  • 각 프롬프트는 경고나 오류 없이 릴리스 빌드를 남겼습니다.
  • 대본, 세션 파일, 리포지토리를 스캔한 결과 라이센스 키의 복사본이 없었습니다.
  • 일부 단계는 페이지와 달리 작동했습니다. 타자를 친 답변으로 세션이 무인 상태로 실행되어 프롬프트 3 계획이 승인되었습니다. 테스트 기계의 모든 프린터가 대화 상자를 열기 때문에, 인쇄된 작업은 없었으므로 두 개의 발송 작업이 XPS로 캡처되었습니다.

라우팅 보고서의 첫 번째 발송 줄은 받은 편지함의 2페이지 결과 보고서인 result-report__RPT-4471.pdf였습니다.

산출

캡처 도구는 라우팅 보고서의 이 줄의 설정을 IronPrint로 전달했습니다. 아래의 PDF는 조정 없이 두 개의 캡처 페이지를 담고 있습니다.

IronPrint가 실행의 라우팅 보고서로부터 발송 작업을 빌드한 결과 보고서 RPT-4471. 두 페이지 모두 Adobe PDF 대기열에서 150 DPI의 A4 세로 페이지로 캡처되어 프린터 대신 파일로 저장되었습니다.

Cursor에도 Plan Mode가 있으며, Cursor 가이드는 그것의 프롬프트 3을 그 모드에서 보냅니다. Codex는 프로젝트 규칙을 CLAUDE.md의 대응행인 AGENTS.md로부터 읽으며, ChatGPT Codex 가이드가 보여줍니다. 이 실행의 Claude Code 버전, 모델 및 총 지속 시간은 테스트 기계 옆의 실행 기록에 표시됩니다.


문제 해결


질문?

질문이 있으시면 support@ironsoftware.com으로 문의하세요.

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

더 읽기

시작할 준비 되셨나요?

NuGet 다운로드 수 52,106버전:2026.11방금 출시