특정 PDF 페이지 삭제

PDF 문서에서 한 페이지 또는 여러 페이지를 제거하려면 removePage 방법을 사용하십시오. 편집된 PDF 문서는 강력한 .NET용 PDF 라이브러리인 IronPDF의 saveAs 메서드를 사용하여 내보낼 수 있습니다. IronPDF를 사용하면 PDF 파일을 프로그래밍 방식으로 생성, 편집 및 조작할 수 있습니다. IronPDF의 기능에 대한 자세한 내용은 IronPDF 공식 웹사이트 에서 확인할 수 있습니다.

설명:

  • IronPdf : 이 코드는 PDF 조작을 위한 .NET 라이브러리인 IronPdf를 사용합니다. 프로젝트에 이 라이브러리가 설치되어 있는지 확인하십시오.

  • PdfDocument.FromFile(inputPath): This loads the PDF from the given file path into a PdfDocument object.

  • RemovePage(0): This method is called on the PdfDocument object to remove the first page of the PDF. Page numbering starts with 0, so 0 represents the first page.

  • SaveAs(outputPath): Any changes made to the PdfDocument object are saved to a new file specified by outputPath.

  • Console.WriteLine : 수정된 PDF 파일의 위치를 나타내는 완료 메시지를 콘솔에 출력합니다.

Keep in mind to replace "input.pdf" and "output.pdf" with your actual file paths.

IronPDF를 사용하여 PDF 페이지를 제거하는 GitHub 예제를 살펴보세요.

시작할 준비 되셨나요?
버전: 2026.2 방금 출시되었습니다