Blazor Server와 WebAssembly 비교
Curtis Chau
Updated: 2026년 4월 22일
IronPDF Blazor Server 및 Blazor WebAssembly(WASM)를 지원합니까?
IronPDF Blazor Server는 지원하지만 Blazor WebAssembly(WASM)는 지원하지 않습니다.
Blazor Server에 PDF를 저장하려면 PDF 문서 스트림을 바이트 배열로 변환한 다음, 이 배열을 JavaScript 함수에 전달하여 다운로드를 수행해야 합니다.
다음은 Blazor Server 애플리케이션에서 PDF 문서를 바이트 배열로 변환한 다음 JavaScript 사용하여 다운로드를 트리거하는 방법의 예입니다.
@page "/pdfdownload"
@inject IJSRuntime JSRuntime
@* A button to download the PDF *@
<button @onclick="DownloadPDF">Download PDF</button>
@code {
private async Task DownloadPDF()
{
// Create a PDF document using IronPDF (this is hypothetical code)
var renderer = new IronPdf.HtmlToPdf();
var pdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello, World!</h1>");
// Convert PDF document to a byte array
byte[] pdfBytes = pdfDocument.BinaryData;
// Call the JavaScript function to download the PDF
await JSRuntime.InvokeVoidAsync("downloadFile", pdfBytes, "example.pdf");
}
}'INSTANT VB TODO TASK: The following line could not be converted:
page "/pdfdownload" inject IJSRuntime JSRuntime * A button [to] download the PDF * <button onclick="DownloadPDF"> Download PDF</button> code
If True Then
'INSTANT VB TODO TASK: Local functions are not converted by Instant VB:
' private async Task DownloadPDF()
' {
' ' Create a PDF document using IronPDF (this is hypothetical code)
' var renderer = New IronPdf.HtmlToPdf();
' var pdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello, World!</h1>");
'
' ' Convert PDF document to a byte array
' byte[] pdfBytes = pdfDocument.BinaryData;
'
' ' Call the JavaScript function to download the PDF
' await JSRuntime.InvokeVoidAsync("downloadFile", pdfBytes, "example.pdf");
' }
End If다음은 PDF 다운로드를 처리하는 JavaScript 함수입니다. 이를 귀하의 _Host.cshtml 또는 index.html 파일에 포함하여야 합니다:
<script>
// Function to download a file from a byte array in JavaScript
function downloadFile(fileBytes, fileName) {
// Convert byte array to a Blob
const blob = new Blob([fileBytes], { type: 'application/pdf' });
// Create a link element for downloading the file
const link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = fileName;
// Append the link to the body, trigger it, and remove it afterwards
document.body.appendChild(link); // Required for Firefox
link.click();
document.body.removeChild(link);
}
</script>
JavaScript
핵심 요점:
- Blazor Server는 서버 측 작업을 허용하며 C# 코드를 서버에서 직접 실행할 수 있습니다.
- Blazor WebAssembly는 클라이언트 측에서 실행되며 IronPDF 와 같은 서버 측 리소스에 직접 접근할 수 없습니다.
저희 웹사이트에서 Blazor 서버 전체 튜토리얼을 보실 수 있습니다: Blazor 서버 튜토리얼

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