特定のPDFページを削除する
PDF ドキュメントから 1 ページまたは複数のページを削除するには、removePage メソッドを使用してください。 編集した PDF ドキュメントは、PDF ファイルをプログラムで作成、編集、操作できる.NET用の強力な PDF ライブラリであるIronPDFの saveAs メソッドを使用してエクスポートできます。 IronPDFの機能については、IronPDF公式ウェブサイトで詳しく学べます。
説明:
IronPdf: このコードはIronPdfを使用しており、PDF操作のため for .NETライブラリです。 プロジェクトにこのライブラリがインストールされていることを確認してください。
PdfDocument.FromFile(inputPath): This loads the PDF from the given file path into a
PdfDocumentobject.RemovePage(0): This method is called on the
PdfDocumentobject to remove the first page of the PDF. Page numbering starts with 0, so0represents the first page.SaveAs(outputPath): Any changes made to the
PdfDocumentobject are saved to a new file specified byoutputPath.- Console.WriteLine: 修正されたPDFの場所を示す完了メッセージをコンソールに出力します。
Keep in mind to replace "input.pdf" and "output.pdf" with your actual file paths.




