IRONSOFTWAREHOME
Razor에서 PDF로 변환(Blazor 서버)

// PM > Install-Package IronPdf.Extensions.Blazor

[Parameter]
public IEnumerable<PersonInfo> persons { get; set; }
public Dictionary<string, object> Parameters { get; set; } = new Dictionary<string, object>();

protected override async Task OnInitializedAsync()
{
    persons = new List<PersonInfo>
    {
        new PersonInfo { Name = "Alice", Title = "Mrs.", Description = "Software Engineer" },
        new PersonInfo { Name = "Bob", Title = "Mr.", Description = "Software Engineer" },
        new PersonInfo { Name = "Charlie", Title = "Mr.", Description = "Software Engineer" }
    };
}
private async void PrintToPdf()
{
    ChromePdfRenderer renderer = new ChromePdfRenderer();

    // Apply text footer
    renderer.RenderingOptions.TextFooter = new TextHeaderFooter()
        {
            LeftText = "{date} - {time}",
            DrawDividerLine = true,
            RightText = "Page {page} of {total-pages}",
            Font = IronSoftware.Drawing.FontTypes.Arial,
            FontSize = 11
        };

    Parameters.Add("persons", persons);

    // Render razor component to PDF
    PdfDocument pdf = renderer.RenderRazorComponentToPdf<Person>(Parameters);

    File.WriteAllBytes("razorComponentToPdf.pdf", pdf.BinaryData);
}
' PM > Install-Package IronPdf.Extensions.Blazor

<Parameter>
Public Property persons As IEnumerable(Of PersonInfo)
Public Property Parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()

Protected Overrides Async Function OnInitializedAsync() As Task
    persons = New List(Of PersonInfo) From {
        New PersonInfo With {.Name = "Alice", .Title = "Mrs.", .Description = "Software Engineer"},
        New PersonInfo With {.Name = "Bob", .Title = "Mr.", .Description = "Software Engineer"},
        New PersonInfo With {.Name = "Charlie", .Title = "Mr.", .Description = "Software Engineer"}
    }
End Function

Private Async Sub PrintToPdf()
    Dim renderer As New ChromePdfRenderer()

    ' Apply text footer
    renderer.RenderingOptions.TextFooter = New TextHeaderFooter() With {
        .LeftText = "{date} - {time}",
        .DrawDividerLine = True,
        .RightText = "Page {page} of {total-pages}",
        .Font = IronSoftware.Drawing.FontTypes.Arial,
        .FontSize = 11
    }

    Parameters.Add("persons", persons)

    ' Render razor component to PDF
    Dim pdf As PdfDocument = renderer.RenderRazorComponentToPdf(Of Person)(Parameters)

    File.WriteAllBytes("razorComponentToPdf.pdf", pdf.BinaryData)
End Sub
NuGet Download
PM > Install-Package IronPdf
Razor에서 PDF로 변환(Blazor 서버)

Razor에서 PDF로 변환(Blazor 서버)

이 예제는 Razor 컴포넌트를 PDF 문서로 변환하는 방법을 보여줍니다.

IronPdf.Extensions.Blazor 패키지는 메인 IronPDF 패키지의 확장입니다. Razor 구성 요소의 콘텐츠 페이지를 PDF로 변환하려면, IronPdf.Extensions.Blazor과(와) 기본 IronPdf 패키지가 모두 필요합니다.

아래 코드 예제에서는 PersonInfo이라는 모델이 이미 생성되었습니다. OnInitializedAsync 메서드에서는, 여러 새로운 PersonInfo 개체를 persons List에 삽입합니다. 그런 다음, persons List을(를) Parameters 사전에서 "persons"라는 문자열과 연결합니다.

PrintToPdf 메서드에서는 ChromePdfRenderer 클래스를 인스턴스화합니다. Razor 구성 요소를 PDF 문서로 변환하려면, RenderRazorComponentToPdf 메서드를 사용합니다. 코드 예제에서는 Parameters 사전을 메서드에 전달하여 렌더링합니다.

Blazor Server에서 Razor 컴포넌트를 PDF로 변환하는 방법을 알아보세요.
GitHub에서 보기

시작할 준비 되셨나요?

Nuget Downloads 21,253,952버전:2026.10방금 출시

Key in blue circle

무료 30일 체험 키를 즉시 받으세요.

Your trial license will be sent to your email address

제한 없음. 100% 무제한 이용. 신용카드 불필요.

bullet_checked신용카드나 계정 생성은 필요하지 않습니다.제한 없음. 100% 무제한 이용. 신용카드 불필요.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
무료 라이브 데모를 예약하세요
Booking Badge

전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.

Iron Software의 고객 로고
부담 없는 무료 상담을 받아보세요
고객님의 정보는 항상 비밀로 유지됩니다.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.
지금 바로 30일 무료 체험판 키를 받으세요.
신용카드나 계정 생성은 필요하지 않습니다.
PDF용 C# NuGet 라이브러리
NuGet을 사용하여 설치하세요

버전: 2026.10

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. 솔루션 탐색기에서 참조를 마우스 오른쪽 버튼으로 클릭하고 NuGet 패키지 관리를 선택합니다.
  2. 찾아보기를 선택하고 "IronPDF"를 검색하세요.
  3. 패키지를 선택하고 설치하세요
C# PDF DLL
DLL 다운로드

버전: 2026.10

또는 여기에서 Windows 설치 프로그램을 다운로드하십시오.

  1. IronPDF를 다운로드하고 솔루션 디렉터리 내의 ~/Libs와 같은 위치에 압축을 푸세요.
  2. Visual Studio 솔루션 탐색기에서 참조를 마우스 오른쪽 버튼으로 클릭합니다. 찾아보기를 선택하고 "IronPDF.dll"을 선택합니다.

라이선스 가격은 999달러 부터 시작합니다.