푸터 콘텐츠로 바로가기
IRONPDF 사용하기

VB.NET에서 PDF 파일을 병합하는 방법

기본 뷰어에서 PDF를 여는 것은 .NET 애플리케이션 개발에서 흔한 작업입니다. IronPDF로 프로그래밍 방식으로 PDF 파일을 생성한 후, 사용자가 선택한 기본 애플리케이션(Adobe Acrobat 또는 Microsoft Edge 등)에서 즉시 표시해야 합니다. 이 가이드는 IronPDF를 사용하여 PDF 파일을 생성하고 System.Diagnostics.Process.Start를 통해 Windows에서 자동으로 열리는 단계를 안내합니다.

IronPDF의 강력한 HTML-to-PDF 변환 기능과 간단한 Process 시작 방법의 조합은 사용자 컴퓨터에 설정된 기본 애플리케이션에서 전문 PDF 파일을 생성하고 표시하는 실용적인 워크플로우를 만듭니다.

.NET 프로젝트에 IronPDF를 어떻게 설치합니까?

어떤 PDF를 생성하거나 열기 전에 프로젝트에 IronPDF가 설치되어 있어야 합니다. NuGet 패키지 관리자 콘솔 또는 .NET CLI 중 하나를 사용하십시오:

Install-Package IronPdf

설치 후, 라이선스 키를 추가하거나 무료 체험으로 시작하여 전체 기능을 활성화하십시오. IronPDF 문서에서는 NuGet을 통한 설치를 비롯한 모든 구성 옵션을 자세히 다룹니다.

설치가 완료되면 HTML-응용 PDF 변환, URL 렌더링, PDF 병합, 워터마킹, 디지털 서명 등을 포함한 전 범위의 IronPDF 기능에 액세스할 수 있습니다.

PDF 파일을 생성하고 여는 방법은 무엇입니까?

가장 간단한 접근 방식은 세 단계로 이루어집니다:

  1. IronPDF로 PDF 문서를 생성하십시오.
  2. 파일을 디렉토리에 저장하십시오.
  3. Process.Start을 사용하여 기본 애플리케이션에서 PDF 열기.

Visual Studio에서 새 콘솔 앱 프로젝트로 시도해 볼 수 있는 완전한 예제입니다:

using IronPdf;
using System.Diagnostics;

// Create a new PDF renderer
var renderer = new ChromePdfRenderer();

// Generate PDF from HTML content
var pdf = renderer.RenderHtmlAsPdf(@"
    <html>
        <body>
            <h1>Invoice #12345</h1>
            <p>Generated on: " + DateTime.Now.ToString("yyyy-MM-dd") + @"</p>
            <table>
                <tr><td>Product</td><td>Price</td></tr>
                <tr><td>IronPDF License</td><td>$299</td></tr>
            </table>
        </body>
    </html>");

// Save the PDF to a file
string outputPath = "invoice.pdf";
pdf.SaveAs(outputPath);

// Open the PDF in the default viewer
Process.Start(new ProcessStartInfo
{
    FileName = outputPath,
    UseShellExecute = true
});
using IronPdf;
using System.Diagnostics;

// Create a new PDF renderer
var renderer = new ChromePdfRenderer();

// Generate PDF from HTML content
var pdf = renderer.RenderHtmlAsPdf(@"
    <html>
        <body>
            <h1>Invoice #12345</h1>
            <p>Generated on: " + DateTime.Now.ToString("yyyy-MM-dd") + @"</p>
            <table>
                <tr><td>Product</td><td>Price</td></tr>
                <tr><td>IronPDF License</td><td>$299</td></tr>
            </table>
        </body>
    </html>");

// Save the PDF to a file
string outputPath = "invoice.pdf";
pdf.SaveAs(outputPath);

// Open the PDF in the default viewer
Process.Start(new ProcessStartInfo
{
    FileName = outputPath,
    UseShellExecute = true
});
Imports IronPdf
Imports System.Diagnostics

' Create a new PDF renderer
Dim renderer As New ChromePdfRenderer()

' Generate PDF from HTML content
Dim pdf = renderer.RenderHtmlAsPdf("
    <html>
        <body>
            <h1>Invoice #12345</h1>
            <p>Generated on: " & DateTime.Now.ToString("yyyy-MM-dd") & "</p>
            <table>
                <tr><td>Product</td><td>Price</td></tr>
                <tr><td>IronPDF License</td><td>$299</td></tr>
            </table>
        </body>
    </html>")

' Save the PDF to a file
Dim outputPath As String = "invoice.pdf"
pdf.SaveAs(outputPath)

' Open the PDF in the default viewer
Process.Start(New ProcessStartInfo With {
    .FileName = outputPath,
    .UseShellExecute = True
})
$vbLabelText   $csharpLabel

이 코드는 먼저 ChromePdfRenderer 인스턴스를 생성하며, 이는 HTML을 PDF로 변환하는 IronPDF의 주요 클래스입니다. RenderHtmlAsPdf 메소드는 HTML 문자열을 PDF 문서 객체로 변환합니다. 이 접근 방식에 대한 자세한 내용은 IronPDF의 HTML-to-PDF 가이드를 참조하십시오.

SaveAs을 사용하여 PDF를 저장한 후, 코드는 Process.StartProcessStartInfo와 함께 사용하여 기본 PDF 뷰어에서 파일을 엽니다. 여기에서 핵심 설정은 UseShellExecute = true이며, 이는 Windows에 PDF 파일을 기본 애플리케이션으로 열라고 지시합니다.

산출

아래 이미지에 표시된 대로, IronPDF는 PDF 파일을 성공적으로 생성하고 시스템에 구성된 기본 뷰어, 이 경우 Opera GX를 사용하여 표시합니다.

C#에서 기본 뷰어로 PDF 열기 방법: 그림 1 - 기본 뷰어를 사용하여 표시된 PDF

최상위 문장이 중요한 이유는 무엇입니까?

.NET 10과 최신 C# 버전을 사용하면 최상위 문장으로 Program 클래스 감싸기가 필요하지 않습니다. 코드는 파일의 최상단에서 직접 실행되어 샘플을 더 짧고 쉽게 이해할 수 있게 만듭니다. 이 가이드의 모든 예제는 이 패턴을 사용합니다.

PDF 문서를 열 때 UseShellExecute가 중요한 이유는 무엇입니까?

.NET Core와 최신 .NET 버전(.NET 5부터 .NET 10까지)에서는 UseShellExecute 매개변수가 기본적으로 false으로 설정됩니다. 명시적으로 true로 설정하지 않으면, PDF 파일을 시작하려고 할 때 애플리케이션이 오류를 발생시킵니다.

using IronPdf;
using System.Diagnostics;
using System.IO;

// Generate a report with IronPDF
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.MarginTop = 50;
renderer.RenderingOptions.MarginBottom = 50;

var pdf = renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Main_Page");

// Save to temp directory for immediate viewing
string tempPath = Path.Combine(Path.GetTempPath(), $"URL_{Guid.NewGuid()}.pdf");
pdf.SaveAs(tempPath);

// IMPORTANT: Set UseShellExecute = true for .NET Core/5+
var startInfo = new ProcessStartInfo
{
    FileName = tempPath,
    UseShellExecute = true  // Required in .NET Core/5+ to open PDF in default viewer
};
Process.Start(startInfo);
using IronPdf;
using System.Diagnostics;
using System.IO;

// Generate a report with IronPDF
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.MarginTop = 50;
renderer.RenderingOptions.MarginBottom = 50;

var pdf = renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Main_Page");

// Save to temp directory for immediate viewing
string tempPath = Path.Combine(Path.GetTempPath(), $"URL_{Guid.NewGuid()}.pdf");
pdf.SaveAs(tempPath);

// IMPORTANT: Set UseShellExecute = true for .NET Core/5+
var startInfo = new ProcessStartInfo
{
    FileName = tempPath,
    UseShellExecute = true  // Required in .NET Core/5+ to open PDF in default viewer
};
Process.Start(startInfo);
Imports IronPdf
Imports System.Diagnostics
Imports System.IO

' Generate a report with IronPDF
Dim renderer As New ChromePdfRenderer()
renderer.RenderingOptions.MarginTop = 50
renderer.RenderingOptions.MarginBottom = 50

Dim pdf = renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Main_Page")

' Save to temp directory for immediate viewing
Dim tempPath As String = Path.Combine(Path.GetTempPath(), $"URL_{Guid.NewGuid()}.pdf")
pdf.SaveAs(tempPath)

' IMPORTANT: Set UseShellExecute = true for .NET Core/5+
Dim startInfo As New ProcessStartInfo With {
    .FileName = tempPath,
    .UseShellExecute = True  ' Required in .NET Core/5+ to open PDF in default viewer
}
Process.Start(startInfo)
$vbLabelText   $csharpLabel

UseShellExecute 속성은 프로세스를 시작하기 위해 운영 체제 셸을 사용할지 여부를 결정합니다. true로 설정되면 Windows는 파일 연결 레지스트리를 사용하여 어느 기본 PDF 리더가 파일을 열지 결정합니다. 이 설정이 없는 최신 .NET 버전에서는 파일을 열 수 없다는 런타임 오류가 발생합니다.

Guid.NewGuid()를 통해 고유 파일 이름을 가진 임시 디렉토리를 사용하면 빠르게 연속적으로 여러 PDF를 생성할 때 파일 충돌을 방지합니다. 기본 임시 폴더는 운영 체제에 의해 정기적으로 자동으로 정리됩니다.

산출

C#에서 기본 뷰어로 PDF 열기 방법: 그림 2 - 기본 뷰어를 사용하여 생성되고 표시된 URL을 PDF로 변환

파일 경로를 올바르게 처리하는 방법은 무엇입니까?

공백과 특수 문자가 포함된 파일 경로는 신중한 처리가 필요합니다. 누락된 디렉토리나 잘못된 경로는 Process.Start에 도달하기 전에 조용히 실패하거나 예외를 던질 수 있습니다. 디렉터리 생성 및 파일 존재 여부 확인을 포함한 접근 방식은 다음과 같습니다:

using IronPdf;
using System.Diagnostics;
using System.IO;

// Generate PDF from HTML file
var renderer = new ChromePdfRenderer();
var htmlContent = File.ReadAllText("template.html");
var pdf = renderer.RenderHtmlAsPdf(htmlContent);

// Create output directory if it doesn't exist
string outputDir = @"C:\PDF Reports\Monthly";
Directory.CreateDirectory(outputDir);

// Build file path with timestamp
string fileName = $"Report_{DateTime.Now:yyyyMMdd_HHmmss}.pdf";
string fullPath = Path.Combine(outputDir, fileName);

// Save the PDF
pdf.SaveAs(fullPath);

// Verify file exists before opening in default PDF viewer
if (File.Exists(fullPath))
{
    Process.Start(new ProcessStartInfo
    {
        FileName = fullPath,
        UseShellExecute = true
    });
}
else
{
    Console.WriteLine($"Error: PDF file not found at {fullPath}");
}
using IronPdf;
using System.Diagnostics;
using System.IO;

// Generate PDF from HTML file
var renderer = new ChromePdfRenderer();
var htmlContent = File.ReadAllText("template.html");
var pdf = renderer.RenderHtmlAsPdf(htmlContent);

// Create output directory if it doesn't exist
string outputDir = @"C:\PDF Reports\Monthly";
Directory.CreateDirectory(outputDir);

// Build file path with timestamp
string fileName = $"Report_{DateTime.Now:yyyyMMdd_HHmmss}.pdf";
string fullPath = Path.Combine(outputDir, fileName);

// Save the PDF
pdf.SaveAs(fullPath);

// Verify file exists before opening in default PDF viewer
if (File.Exists(fullPath))
{
    Process.Start(new ProcessStartInfo
    {
        FileName = fullPath,
        UseShellExecute = true
    });
}
else
{
    Console.WriteLine($"Error: PDF file not found at {fullPath}");
}
Imports IronPdf
Imports System.Diagnostics
Imports System.IO

' Generate PDF from HTML file
Dim renderer As New ChromePdfRenderer()
Dim htmlContent As String = File.ReadAllText("template.html")
Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)

' Create output directory if it doesn't exist
Dim outputDir As String = "C:\PDF Reports\Monthly"
Directory.CreateDirectory(outputDir)

' Build file path with timestamp
Dim fileName As String = $"Report_{DateTime.Now:yyyyMMdd_HHmmss}.pdf"
Dim fullPath As String = Path.Combine(outputDir, fileName)

' Save the PDF
pdf.SaveAs(fullPath)

' Verify file exists before opening in default PDF viewer
If File.Exists(fullPath) Then
    Process.Start(New ProcessStartInfo With {
        .FileName = fullPath,
        .UseShellExecute = True
    })
Else
    Console.WriteLine($"Error: PDF file not found at {fullPath}")
End If
$vbLabelText   $csharpLabel

이 코드는 운영 체제와 관계없이 파일 경로를 올바르게 구축하기 위해 Path.Combine를 사용하고, Directory.CreateDirectory로 필요한 디렉토리를 생성하며, 기본 뷰어에서 PDF를 열기 전에 파일 존재 여부를 확인하는 여러 모범 사례를 보여줍니다.

파일 이름의 타임스탬프는 유일성을 보장하고 각 PDF가 생성된 시점을 명확하게 기록합니다. PDF 병합 또는 분할, 워터마크 추가, 디지털 서명, 머리글 및 바닥글 등 고급 PDF 조작 옵션에 대해 알아보려면 IronPDF의 사용법 가이드를 탐색하십시오.

공백이 있는 경로에 대해서는 어떻게 해야 합니까?

Path.Combine은 경로를 셸 확장에 의존하지 않고 문자열로 구축하기 때문에 공백을 올바르게 처리합니다. ProcessStartInfo 클래스는 UseShellExecute = true일 때 인용된 경로도 올바르게 처리합니다. 경로를 셸 명령에 직접 전달하는 경우 항상 큰따옴표로 둘러싸야 합니다. Process.Start을 사용하면, FileName 속성은 수동 인용이 필요하지 않습니다.

실제 사용 준비가 된 모범 사례를 적용하는 방법은 무엇입니까?

실제 응용 프로그램을 위해 PDF 수명 주기를 오류 처리, 구성 가능한 렌더링 옵션, 예측 가능한 출력 디렉터리를 포함하는 보다 완전한 워크플로를 고려하십시오:

using IronPdf;
using IronPdf.Rendering;
using System.Diagnostics;
using System.IO;

static void GenerateAndDisplayPdf(string htmlContent, string documentName)
{
    try
    {
        // Configure IronPDF renderer with production settings
        var renderer = new ChromePdfRenderer
        {
            RenderingOptions = new ChromePdfRenderOptions
            {
                PaperSize = PdfPaperSize.A4,
                PrintHtmlBackgrounds = true,
                CreatePdfFormsFromHtml = true
            }
        };

        // Generate the PDF
        var pdf = renderer.RenderHtmlAsPdf(htmlContent);

        // Use the user's Documents folder for better accessibility
        string documentsPath = Environment.GetFolderPath(
            Environment.SpecialFolder.MyDocuments);
        string pdfFolder = Path.Combine(documentsPath, "Generated PDFs");
        Directory.CreateDirectory(pdfFolder);
        string outputPath = Path.Combine(pdfFolder, $"{documentName}.pdf");

        pdf.SaveAs(outputPath);

        // Open PDF in default viewer without waiting for it to close
        Process.Start(new ProcessStartInfo
        {
            FileName = outputPath,
            UseShellExecute = true  // Essential for opening PDF in default application
        });

        Console.WriteLine($"PDF opened: {outputPath}");
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Error generating or opening PDF: {ex.Message}");
    }
}
using IronPdf;
using IronPdf.Rendering;
using System.Diagnostics;
using System.IO;

static void GenerateAndDisplayPdf(string htmlContent, string documentName)
{
    try
    {
        // Configure IronPDF renderer with production settings
        var renderer = new ChromePdfRenderer
        {
            RenderingOptions = new ChromePdfRenderOptions
            {
                PaperSize = PdfPaperSize.A4,
                PrintHtmlBackgrounds = true,
                CreatePdfFormsFromHtml = true
            }
        };

        // Generate the PDF
        var pdf = renderer.RenderHtmlAsPdf(htmlContent);

        // Use the user's Documents folder for better accessibility
        string documentsPath = Environment.GetFolderPath(
            Environment.SpecialFolder.MyDocuments);
        string pdfFolder = Path.Combine(documentsPath, "Generated PDFs");
        Directory.CreateDirectory(pdfFolder);
        string outputPath = Path.Combine(pdfFolder, $"{documentName}.pdf");

        pdf.SaveAs(outputPath);

        // Open PDF in default viewer without waiting for it to close
        Process.Start(new ProcessStartInfo
        {
            FileName = outputPath,
            UseShellExecute = true  // Essential for opening PDF in default application
        });

        Console.WriteLine($"PDF opened: {outputPath}");
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Error generating or opening PDF: {ex.Message}");
    }
}
Imports IronPdf
Imports IronPdf.Rendering
Imports System.Diagnostics
Imports System.IO

Module PdfGenerator

    Sub GenerateAndDisplayPdf(htmlContent As String, documentName As String)
        Try
            ' Configure IronPDF renderer with production settings
            Dim renderer As New ChromePdfRenderer With {
                .RenderingOptions = New ChromePdfRenderOptions With {
                    .PaperSize = PdfPaperSize.A4,
                    .PrintHtmlBackgrounds = True,
                    .CreatePdfFormsFromHtml = True
                }
            }

            ' Generate the PDF
            Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)

            ' Use the user's Documents folder for better accessibility
            Dim documentsPath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
            Dim pdfFolder As String = Path.Combine(documentsPath, "Generated PDFs")
            Directory.CreateDirectory(pdfFolder)
            Dim outputPath As String = Path.Combine(pdfFolder, $"{documentName}.pdf")

            pdf.SaveAs(outputPath)

            ' Open PDF in default viewer without waiting for it to close
            Process.Start(New ProcessStartInfo With {
                .FileName = outputPath,
                .UseShellExecute = True  ' Essential for opening PDF in default application
            })

            Console.WriteLine($"PDF opened: {outputPath}")
        Catch ex As Exception
            Console.WriteLine($"Error generating or opening PDF: {ex.Message}")
        End Try
    End Sub

End Module
$vbLabelText   $csharpLabel

이 예제에는 구조적 오류 처리가 포함되어 있으며, 사용자 문서 폴더에 PDF를 저장하여 응용 프로그램이 어떻게 실행되는지에 상관없이 접근할 수 있습니다. 비즈니스 문서에 적합한 렌더링 옵션으로 IronPDF를 구성하기도 합니다: A4 용지 크기, HTML 백그라운드 인쇄 활성화, HTML 폼 요소에서 자동 양식 필드 생성.

IronPDF 사용법 라이브러리에서 대화형 PDF 양식맞춤형 워터마크에 대해 더 배울 수 있습니다.

이 방법은 PDF 뷰어가 닫힐 때까지 기다리지 않고, 사용자가 문서를 보는 동안 응용 프로그램이 계속 실행될 수 있도록 합니다. Microsoft의 Process.Start에 대한 문서에 따르면, 이러한 접근 방식은 적절한 리소스 관리를 보장하고 응용 프로그램이 장기 실행 뷰어 프로세스에 의해 차단되는 것을 방지합니다. Microsoft Learn의 ProcessStartInfo 클래스 참조는 창 스타일, 동사(열기, 인쇄), 작업 디렉터리 등을 포함하여 구성할 수 있는 모든 속성 목록을 제공합니다.

C#에서 기본 뷰어로 PDF 열기 방법: 그림 3 - PDF 생성에서 보기까지의 프로세스 워크플로우

렌더링 옵션 구성

ChromePdfRenderOptions 클래스는 출력 PDF에 대한 세밀한 제어를 제공합니다. 일반 설정에는 다음이 포함됩니다:

  • PaperSize -- PdfPaperSize.A4, Letter이나 표준 크기로 설정.
  • PrintHtmlBackgrounds -- HTML에서 배경 색상 및 이미지를 렌더링합니다.
  • CreatePdfFormsFromHtml -- HTML <input><select> 요소를 대화형 PDF 폼 필드로 변환합니다.
  • MarginTop / MarginBottom / MarginLeft / MarginRight -- 밀리미터 단위로 페이지 여백을 제어합니다.

이러한 설정은 HTML 문자열, 로컬 HTML 파일 또는 원격 URL을 렌더링할 때 똑같이 적용됩니다.

자동 생성된 PDF에서 데이터를 추출하는 방법은?

PDF가 생성되어 열리면, 내용을 다시 읽어야 할 수도 있습니다. IronPDF는 PDF 파일에서 텍스트 추출을 지원하며, 이는 로깅, 검증 또는 후속 처리에 유용합니다.

PDF-to-image 변환을 사용하여 개별 페이지를 PNG 또는 JPEG 파일로 렌더링할 수도 있습니다. 이것은 미리보기 생성 및 썸네일 작업 흐름에서 일반적입니다.

두 기능 모두 동일한 IronPDF 라이브러리를 통해 제공되며 추가 종속성이 필요하지 않습니다. IronPDF API 전체 문서는 모든 추출 및 변환 작업에 대한 메서드 수준 참조를 제공합니다.

PDF 뷰어가 설치되어 있지 않은 경우 어떻게 되나요?

대상 컴퓨터에 PDF 뷰어가 설치되어 있지 않으면, Windows는 사용자에게 응용 프로그램을 선택하거나 Microsoft Store를 방문하여 찾으라는 대화 상자를 표시합니다. 이것은 표준 Windows 동작이며 Process.Start의 통제를 벗어납니다.

생산 코드에서 이를 우아하게 처리하기 위해, Win32Exception가 던지는 Process.Start 를 잡아 .pdf 파일 확장자에 대한 등록된 핸들러가 없을 때를 처리할 수 있습니다:

using System.ComponentModel;
using System.Diagnostics;

try
{
    Process.Start(new ProcessStartInfo
    {
        FileName = outputPath,
        UseShellExecute = true
    });
}
catch (Win32Exception ex) when (ex.NativeErrorCode == 1155)
{
    // Error 1155: No application associated with the file extension
    Console.WriteLine("No PDF viewer is installed. Please install a PDF reader such as Adobe Acrobat Reader.");
}
using System.ComponentModel;
using System.Diagnostics;

try
{
    Process.Start(new ProcessStartInfo
    {
        FileName = outputPath,
        UseShellExecute = true
    });
}
catch (Win32Exception ex) when (ex.NativeErrorCode == 1155)
{
    // Error 1155: No application associated with the file extension
    Console.WriteLine("No PDF viewer is installed. Please install a PDF reader such as Adobe Acrobat Reader.");
}
Imports System.ComponentModel
Imports System.Diagnostics

Try
    Process.Start(New ProcessStartInfo With {
        .FileName = outputPath,
        .UseShellExecute = True
    })
Catch ex As Win32Exception When ex.NativeErrorCode = 1155
    ' Error 1155: No application associated with the file extension
    Console.WriteLine("No PDF viewer is installed. Please install a PDF reader such as Adobe Acrobat Reader.")
End Try
$vbLabelText   $csharpLabel

오류 코드 1155ERROR_NO_ASSOCIATION에 해당하며, 이는 파일 형식에 대해 등록된 애플리케이션이 없을 때 Windows가 반환합니다. 이 특정 오류를 잡으면 충돌하는 대신 유용한 메시지를 표시할 수 있습니다. Windows 시스템 오류 코드의 전체 목록은 Microsoft Learn에서 Win32 오류 코드 참조에 문서화되어 있습니다.

애플리케이션에 적합한 접근 방식을 선택하는 방법은?

PDF를 여는 방법은 작성 중인 애플리케이션의 유형에 따라 다릅니다:

다른 애플리케이션 유형에 대한 PDF 열기 전략 비교
애플리케이션 유형 권장 접근 방식 주요 고려 사항
콘솔 또는 데스크톱 앱 Process.Start와 UseShellExecute = true 간단하고 추가 종속성이 없음
Windows 서비스 디스크에 저장; IPC 또는 메시지 큐를 통해 사용자에게 알림 서비스는 데스크톱 세션 없이 실행됨
웹 애플리케이션 (ASP.NET) 파일 다운로드로 또는 브라우저 내부에 PDF 스트림으로 표시 웹 서버 컨텍스트에서는 Process.Start가 유효하지 않음
MAUI 또는 WinForms Process.Start 또는 내장 PDF 컨트롤 임베디드 뷰잉은 더 나은 인앱 경험을 제공함

ASP.NET Core로 구축된 웹 애플리케이션의 경우 Process.Start를 사용하지 마세요. 서버 프로세스는 헤드리스 환경에서 실행되며 데스크톱 애플리케이션을 열 수 없습니다. 대신 File()application/pdf MIME 타입을 사용하여 파일 결과로 PDF를 반환하고 브라우저가 디스플레이를 처리할 수 있도록 하세요.

콘솔 및 데스크톱 애플리케이션의 경우, Process.StartUseShellExecute = true가 가장 단순하고 신뢰할 수 있는 옵션으로 남아 있습니다.

참고해 주세요참고: PDF 뷰어가 설치되어 있지 않으면, Windows는 설치하거나 다운로드하라는 대화 상자를 표시할 수 있습니다.

.NET 애플리케이션에서 PDF 생성 및 뷰잉을 시작할 준비가 되셨습니까? 무료 체험판으로 전체 기능 세트에 액세스하거나, 프로젝트에 맞는 계획을 찾기 위해 IronPDF 라이선싱 페이지를 검토하십시오.

자주 묻는 질문

C#을 사용하여 기본 뷰어에서 PDF를 여는 방법은 무엇인가요?

IronPDF로 PDF를 생성하고 System.Diagnostics.Process.Start를 사용하여 사용자의 기본 PDF 애플리케이션에서 열 수 있습니다.

IronPDF란 무엇인가요?

IronPDF는 개발자가 애플리케이션 내에서 프로그래밍 방식으로 PDF 파일을 생성, 편집 및 조작할 수 있게 해주는 .NET 라이브러리입니다.

IronPDF를 사용하는 시스템 요구 사항은 무엇인가요?

IronPDF는 모든 .NET 애플리케이션과 호환되며 Windows, macOS 및 Linux 플랫폼에서 작동합니다. .NET Framework 또는 .NET Core/5+가 설치되어야 합니다.

IronPDF로 기본적으로 Adobe Acrobat에서 PDF를 열 수 있나요?

네, IronPDF는 사용자가 설정한 기본 PDF 뷰어인 Adobe Acrobat, Microsoft Edge 또는 다른 PDF 뷰잉 애플리케이션에서 열릴 PDF를 생성할 수 있습니다.

IronPDF와 함께 System.Diagnostics.Process.Start는 어떻게 작동하나요?

System.Diagnostics.Process.Start는 생성된 PDF 파일을 기본 뷰어에서 열기 위해 사용됩니다. IronPDF가 파일을 생성한 후에 이 메서드는 PDF 파일과 연결된 기본 응용 프로그램을 실행하여 표시합니다.

IronPDF로 PDF 파일을 편집할 수 있나요?

네, IronPDF를 사용하여 기존 PDF 파일에 텍스트, 이미지, 주석 등을 추가하여 편집하고 저장하거나 표시할 수 있습니다.

IronPDF가 지원하는 프로그래밍 언어는 무엇인가요?

IronPDF는 주로 C#과 함께 사용되지만 VB.NET 및 다른 .NET 지원 언어로 프로젝트에 통합할 수도 있습니다.

IronPDF로 생성 후 PDF 표시를 자동화할 수 있나요?

네, IronPDF로 PDF를 생성한 후에는 System.Diagnostics.Process.Start를 사용하여 사용자의 기본 뷰어에서 즉시 열 수 있게 자동화할 수 있습니다.

IronPDF를 사용하는 코드 예제가 있나요?

IronPDF 문서는 C#을 사용하여 기본 뷰어에서 PDF를 여는 방법을 포함하여 PDF를 생성 및 조작하는 다양한 코드 예제를 제공합니다.

IronPDF의 일반적인 사용 사례는 무엇인가요?

IronPDF의 일반적인 사용 사례로는 보고서, 송장 및 기타 문서 생성, HTML을 PDF로 변환, .NET 애플리케이션에서 PDF 표시 프로세스 자동화가 포함됩니다.

IronPDF가 .NET 10과 호환되며, 이로 인해 어떤 이점이 있나요?

네. IronPDF는 .NET 10과 완전히 호환되며, 런타임 및 언어 향상이 포함되어 있습니다. IronPDF를 사용하면 .NET 10에서 성능 개선의 이점을 누릴 수 있으며, 힙 할당이 줄어들고 PDF 생성 속도가 빨라지며 최신 API 및 플랫폼과의 통합이 원활해집니다.

Curtis Chau
기술 문서 작성자

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

커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다.

아이언 서포트 팀

저희는 주 5일, 24시간 온라인으로 운영합니다.
채팅
이메일
전화해