Created
May 13, 2024 10:30
-
-
Save conholdate-gists/7027f9de9e56bb986dc7b95d1b4c92c8 to your computer and use it in GitHub Desktop.
Add or Delete Pages in PDF using C# | Insert Remove Pages in PDF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the input PDF document | |
Document document = new Document("Sample.pdf"); | |
// Delete the Page Number Two - The 2nd Page | |
document.Pages.Delete(1); | |
// Save output PDF file | |
document.Save("Page_Deleted.pdf"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the input PDF document | |
Document document = new Document("Sample.pdf"); | |
// Add an empty page at the end of document | |
Page page = document.Pages.Add(); | |
// Save output PDF file | |
document.Save("Page_Added.pdf"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the input PDF document | |
Document document = new Document("Sample.pdf"); | |
// Add an empty page after 2 pages | |
document.Pages.Insert(2); | |
// Save output PDF file | |
document.Save("Page_Inserted.pdf"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment