제품 비교 PDFsharp Add Page Numbers to PDF VS IronPDF (Example) 커티스 차우 업데이트됨:7월 28, 2025 다운로드 IronPDF NuGet 다운로드 DLL 다운로드 윈도우 설치 프로그램 무료 체험 시작하기 LLM용 사본 LLM용 사본 LLM용 마크다운 형식으로 페이지를 복사하세요 ChatGPT에서 열기 ChatGPT에 이 페이지에 대해 문의하세요 제미니에서 열기 제미니에게 이 페이지에 대해 문의하세요 Grok에서 열기 Grok에게 이 페이지에 대해 문의하세요 혼란 속에서 열기 Perplexity에게 이 페이지에 대해 문의하세요 공유하다 페이스북에 공유하기 트위터에 공유하기 LinkedIn에 공유하기 URL 복사 이메일로 기사 보내기 The PDF (Portable Document Format) is a universally accepted format for sharing documents across various platforms. Its ability to preserve formatting, fonts, and layout makes it indispensable for business, legal, and educational purposes. As the need for PDF manipulation grows in software development, the .NET ecosystem provides developers with multiple libraries for working with PDFs. Among them, PDFSharp and IronPDF stand out as powerful solutions for PDF creation and manipulation. This article will show you how to add page numbers to PDF documents using PDFsharp and IronPDF in C#, and compare the features of both libraries to help you decide which one best suits your needs. What is IronPDF? IronPDF is a powerful .NET library designed for seamless PDF creation, manipulation, and rendering. It stands out for its ability to convert HTML, CSS, and JavaScript directly into high-quality PDFs using a Chromium-based engine. This makes IronPDF an ideal solution for developers who need to convert dynamic web pages or complex HTML content into a well-formatted PDF, preserving the layout and style as it appears in the browser. Key Features of IronPDF: Converts HTML, JavaScript, and CSS to high-quality PDFs. Enables custom headers, footers, watermarks, and other page elements. Supports merging PDF files and splitting them. Works seamlessly with .NET applications, including ASP.NET and MVC frameworks. Provides precise control over PDF rendering, ensuring content is displayed as intended. Offers a straightforward API for easy integration into projects. To explore more advanced features and examples, refer to the official IronPDF documentation. Installing IronPDF To add IronPDF to your project, use the NuGet package manager in Visual Studio. You can install it using the Visual Command-Line interface or search directly in the NuGet Package Manager. Command-line installation: Install-Package IronPdf Alternatively, you can search for "IronPDF" in the NuGet Package Manager and install it from there. What is PDFSharp? PDFsharp is a versatile .NET library focused on creating and manipulating PDF documents with high flexibility. Unlike other libraries, PDFsharp allows detailed control over the structure and design of PDFs, making it a great choice for developers who want to create documents from scratch or modify existing PDFs. With its rich API, PDFsharp supports a wide array of document manipulation tasks, including adding text, images, tables, and even page numbers. Key Features of PDFSharp: Creates, reads, and modifies PDF documents. Customizable page events to add elements such as page numbers or footers. Supports adding images, text, tables, and other content. Offers detailed control over PDF layout and structure. Can modify existing PDFs, including merging or splitting documents. Open-source library with flexibility for developers to customize or extend. To dive deeper into PDFSharp's functionality and usage, check out the PDFSharp GitHub repository. Installing PDFsharp To get started with PDFSharp, install the package via NuGet using the command line: Command-line installation: Install-Package PDFSharp Alternatively, you can search for "PDFSharp" in the NuGet Package Manager and install it from there. How to Add Page Numbers using IronPDF IronPDF is a versatile PDF library designed to handle a wide range of PDF operations, including adding page numbers. IronPDF operates internally on a Chromium engine, allowing it to offer precise rendering of HTML content as PDFs. With its simple API, adding page numbers to your PDF is both efficient and straightforward. The following code is an example of how to add page numbers using IronPDF in C#: using IronPdf; class Program { static void Main(string[] args) { var html = "<h1>Hello World!</h1><p>This document was generated using IronPDF</p>"; // Instantiate ChromePdfRenderer ChromePdfRenderer renderer = new ChromePdfRenderer() { // Set rendering options for page header RenderingOptions = { HtmlHeader = new HtmlHeaderFooter { HtmlFragment = "<center><i>{page} of {total-pages}</i></center>" // Page number format }, } }; // Render given HTML as PDF PdfDocument pdf = renderer.RenderHtmlAsPdf(html); // Save the resulting PDF with page numbers pdf.SaveAs("pageNumbers.pdf"); } } using IronPdf; class Program { static void Main(string[] args) { var html = "<h1>Hello World!</h1><p>This document was generated using IronPDF</p>"; // Instantiate ChromePdfRenderer ChromePdfRenderer renderer = new ChromePdfRenderer() { // Set rendering options for page header RenderingOptions = { HtmlHeader = new HtmlHeaderFooter { HtmlFragment = "<center><i>{page} of {total-pages}</i></center>" // Page number format }, } }; // Render given HTML as PDF PdfDocument pdf = renderer.RenderHtmlAsPdf(html); // Save the resulting PDF with page numbers pdf.SaveAs("pageNumbers.pdf"); } } $vbLabelText $csharpLabel Output This code demonstrates how to easily insert page numbers in the header of a PDF document. The HtmlHeaderFooter object is used to specify the header content, and placeholders like {page} and {total-pages} automatically populate with the page number and the total page count respectively. With this approach, IronPDF simplifies the process of rendering HTML as PDFs while managing page number placement effortlessly. How to Add Page Numbers using PDFsharp PDFSharp is a comprehensive library for working with PDFs in C#. It provides tools for creating, modifying, and reading PDFs. Though it is not designed specifically for HTML-to-PDF conversion, it offers robust control over PDF documents, including the ability to add page numbers using custom page events. Whether you wish to add page numbers to just the first page, or second page, a range of pages, or just all of them. Here’s an example of how to add page numbers using PDFSharp: using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Drawing; internal class Program { static void Main(string[] args) { // Create a new PDF document var doc = new PdfDocument(); doc.Info.Title = "Page Numbers Example"; // Add a new page to the document PdfPage page = doc.AddPage(); // Create graphics object for drawing var gfx = XGraphics.FromPdfPage(page); var font = new XFont("Arial", 12); // Draw page number in the footer gfx.DrawString("Page " + doc.PageCount, font, XBrushes.Black, new XPoint(500, 770)); // Save the PDF file doc.Save("PdfSharpOutput.pdf"); } } using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Drawing; internal class Program { static void Main(string[] args) { // Create a new PDF document var doc = new PdfDocument(); doc.Info.Title = "Page Numbers Example"; // Add a new page to the document PdfPage page = doc.AddPage(); // Create graphics object for drawing var gfx = XGraphics.FromPdfPage(page); var font = new XFont("Arial", 12); // Draw page number in the footer gfx.DrawString("Page " + doc.PageCount, font, XBrushes.Black, new XPoint(500, 770)); // Save the PDF file doc.Save("PdfSharpOutput.pdf"); } } $vbLabelText $csharpLabel Output Conclusion In summary, IronPDF stands out for its ability to easily add page numbers to existing PDF documents in one concise block of code, giving you full control over how and where your page numbers are displayed. While PDFsharp is a versatile option for creating and manipulating PDFs with fine-grained control, it does lead to a more manual, harder-to-implement approach to adding page numbers to PDF files. IronPDF's commercial licensing is available, allowing users to evaluate its features before committing to a purchase. For more information on IronPDF, visit the documentation page, and for PDFSharp, check out the GitHub repository. 참고해 주세요PDFsharp is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by PDFsharp. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing. 자주 묻는 질문 C#을 사용하여 PDF에 페이지 번호를 추가하려면 어떻게 해야 하나요? IronPDF를 사용하여 C#의 PDF에 페이지 번호를 추가하려면 {page} 및 {총 페이지 수}와 같은 자리 표시자를 통합하여 사용자 정의 머리글 또는 바닥글을 설정하고 HtmlHeaderFooter 클래스를 사용하여 페이지 번호를 표시할 수 있습니다. PDF 조작에 IronPDF를 사용하면 어떤 이점이 있나요? IronPDF는 HTML, CSS, JavaScript를 PDF로 변환하고, 워터마크를 추가하고, 사용자 정의 머리글과 바닥글을 통합하는 등 포괄적인 기능을 제공합니다. Chromium 기반 엔진을 사용하여 웹 개발자에게 이상적인 고품질 PDF 렌더링을 보장합니다. PDFsharp는 PDF 생성 측면에서 IronPDF와 어떻게 다른가요? PDFsharp는 문서 구조와 디자인을 세부적으로 제어할 수 있는 보다 수동적인 PDF 생성 방식을 제공합니다. 텍스트, 이미지, 표와 같은 요소를 직접 추가하는 데 중점을 두는 반면, IronPDF는 HTML 기반 렌더링으로 프로세스를 간소화합니다. .NET 애플리케이션에서 IronPDF의 설치 단계는 어떻게 되나요? .NET 애플리케이션에 IronPDF를 설치하려면 Visual Studio의 NuGet 패키지 관리자를 사용하세요. 명령줄에서 Install-Package IronPdf 명령을 실행하거나 NuGet 패키지 관리자 인터페이스에서 'IronPDF'를 직접 검색할 수 있습니다. IronPDF를 웹사이트를 PDF로 변환하는 데 사용할 수 있나요? 예, IronPDF는 전체 웹사이트 또는 특정 HTML 콘텐츠를 PDF 문서로 변환할 수 있습니다. 이 도구는 크롬 기반 엔진을 사용하여 CSS 및 JavaScript를 포함한 웹 페이지를 정확하게 렌더링합니다. IronPDF는 PDF에 워터마크를 추가하는 데 적합하나요? IronPDF는 PDF에 워터마크를 추가하는 데 매우 적합합니다. 렌더링 프로세스 중에 텍스트 또는 이미지 기반 워터마크를 PDF 문서에 매끄럽게 통합할 수 있습니다. PDFsharp를 사용하는 일반적인 사용 사례는 무엇인가요? PDFsharp는 일반적으로 텍스트, 이미지, 표를 추가하고 레이아웃을 정밀하게 조정하는 등 PDF 문서 작성에 대한 세부적인 제어가 필요한 프로젝트에 사용됩니다. PDF 구조를 수동으로 조작해야 하는 개발자가 선호합니다. 개발자는 IronPDF와 PDFsharp 중에서 어떻게 선택할 수 있나요? 개발자는 특히 HTML 콘텐츠를 다룰 때 수동 개입이 적은 간단하고 고품질의 렌더링 솔루션이 필요한 경우 IronPDF를 선택해야 합니다. PDFsharp는 광범위한 사용자 정의와 PDF 요소에 대한 수동 제어가 필요한 사용자에게 더 적합합니다. 커티스 차우 지금 바로 엔지니어링 팀과 채팅하세요 기술 문서 작성자 커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다. 커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다. 관련 기사 게시됨 1월 20, 2026 Generate PDF Using iTextSharp in MVC vs IronPDF: A Complete Comparison ITextSharp와 IronPDF를 사용하여 ASP.NET MVC에서 PDF 생성 방법을 비교하세요. 어떤 라이브러리가 더 나은 HTML 렌더링과 더 쉬운 구현을 제공하는지 알아보세요. 더 읽어보기 업데이트됨 1월 7, 2026 Ghostscript GPL vs IronPDF: Technical Comparison Guide 고스트스크립트 GPL과 IronPDF의 주요 차이점을 알아보세요. AGPL 라이선스와 상용, 명령줄 스위치와 네이티브 .NET API, HTML-PDF 기능을 비교해 보세요. 더 읽어보기 업데이트됨 1월 21, 2026 Which ASP.NET PDF Library Offers the Best Value for .NET Core Development? ASP.NET Core 애플리케이션을 위한 최고의 PDF 라이브러리를 찾아보세요. IronPDF의 Chrome 엔진과 Aspose 및 Syncfusion의 대안을 비교해 보세요. 더 읽어보기 PDFsharp vs QuestPDF (C# PDF Library In-depth Comparison)IronPDF vs PDFsharp PDF-to-Image Co...
게시됨 1월 20, 2026 Generate PDF Using iTextSharp in MVC vs IronPDF: A Complete Comparison ITextSharp와 IronPDF를 사용하여 ASP.NET MVC에서 PDF 생성 방법을 비교하세요. 어떤 라이브러리가 더 나은 HTML 렌더링과 더 쉬운 구현을 제공하는지 알아보세요. 더 읽어보기
업데이트됨 1월 7, 2026 Ghostscript GPL vs IronPDF: Technical Comparison Guide 고스트스크립트 GPL과 IronPDF의 주요 차이점을 알아보세요. AGPL 라이선스와 상용, 명령줄 스위치와 네이티브 .NET API, HTML-PDF 기능을 비교해 보세요. 더 읽어보기
업데이트됨 1월 21, 2026 Which ASP.NET PDF Library Offers the Best Value for .NET Core Development? ASP.NET Core 애플리케이션을 위한 최고의 PDF 라이브러리를 찾아보세요. IronPDF의 Chrome 엔진과 Aspose 및 Syncfusion의 대안을 비교해 보세요. 더 읽어보기