特定のPDFページを削除する
PDFドキュメントから単一または複数のページを削除するには、removePageメソッドを使用してください。 編集されたPDFドキュメントは、その後、強力なPDFライブラリであるIronPDFのsaveAsメソッドを使用してエクスポートできます。IronPDFは、プログラムでPDFファイルを作成、編集、操作することを可能にします。 IronPDFの機能については、IronPDF公式ウェブサイトで詳しく学べます。
説明:
IronPdf: このコードはIronPdfを使用しており、PDF操作のための.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.




