Rank: Advanced Member
Groups: Registered
Joined: 10/13/2017(UTC) Posts: 52  Location: Freiburg Thanks: 3 times
|
Hi, when I try to delete the last page of a pdf, I get the error, that the index is out of range:
PdfDocument fullDocument = PdfDocument.Load(pdfFile); int lastPage = fullDocument.Pages.Count - 1 fullDocument.Pages.DeleteAt(lastPage);
fullDocument.Pages.Count - 2 or fullDocument.Pages.Count - 3 works fine
How can I delete the last page?
Thanks for your time!
Regards Peter
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,123
Thanks: 8 times Was thanked: 131 time(s) in 128 post(s)
|
|
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/13/2017(UTC) Posts: 52  Location: Freiburg Thanks: 3 times
|
Hi, many thanks for the resolution, great job.
Peter
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/1/2025(UTC) Posts: 1  Location: Gorizia
|
Hallo, I'm just a new user and yesterday I have installed version 4.96.2704 with Nuget Manager in Visual Studio 2022.
Quote: "when I try to delete the last page of a pdf, I get the error, that the index is out of range:" /Quote
My three lines of code: Dim Index as Integer Index = PdfToolStripPages2.PdfViewer.CurrentIndex IssuePdfViewer2.Document.Pages.DeleteAt(Index)
Well: I'm getting the above quoted error if Index equals the Index of the last page! Not fixed 7 years ago?
Paolo.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,123
Thanks: 8 times Was thanked: 131 time(s) in 128 post(s)
|
Looks like it's back!
Will be fixed in the next release. Thanks!
|
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close