Usuń określone strony z pliku PDF
Aby usunać pojedyncze lub wiele stron z dokumentu PDF, nalezy uzyc metody removePage. Edytowany dokument PDF mozna nastepnie wyeksportowac, korzystajac z metody saveAs IronPDF, potężnej biblioteki PDF dla .NET, ktora pozwala tworzyc, edytowac i manipulowac plikami PDF programowo. Mozesz dowiedziec sie wiecej o funkcjach IronPDF na oficjalnej stronie IronPDF.
Wyjaśnienie:
IronPdf: Kod wykorzystuje IronPdf, biblioteke .NET do manipulacji PDF. Upewnij sie, ze ta biblioteka jest zainstalowana w twoim projekcie.
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: Wyswietla komunikat o ukonczeniu w konsoli, wskazujac lokalizacje zmodyfikowanego PDF.
Keep in mind to replace "input.pdf" and "output.pdf" with your actual file paths.
Odkryj przyklady GitHub dotyczace usuwania stron PDF za pomoca IronPDF




