Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Delete optionalcontentgroup |
Post Reply
|
| Author | |
nieguizhi
Beginner
Joined: 12 Jan 16 Location: shanghai Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: Delete optionalcontentgroupPosted: 25 Jan 16 at 8:49AM |
|
Hi, I use the following code to delete the optionalcontentgroup, however it does not remove the optionalcontentgroup. Could somebody give me some suggestion, thanks! look forward to your replay. int contentNum = DPL.ContentStreamCount(); int optionNum = DPL.OptionalContentGroupCount(); for (int i=0; i<=optionNum; ++i) { int optionID = DPL.GetOptionalContentGroupID(i); CStringW optionalName = DPL.GetOptionalContentGroupName(optionID).c_str(); DPL.DeleteOptionalContentGroup(optionID); } DPL.SaveToFile(L"no_option.pdf");
|
|
![]() |
|
tfrost
Senior Member
Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(1)
Quote Reply
Posted: 25 Jan 16 at 12:21PM |
|
You should first re-sequence the loop. You should always start with the highest value and descend from the top down when deleting, because deleting the value i makes the next item become i. Also the content group ID index base is documented as 1, not 0.
|
|
![]() |
|
nieguizhi
Beginner
Joined: 12 Jan 16 Location: shanghai Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 Jan 16 at 4:10AM |
|
could you mean this:
for (int i=optionNum; i>=1; --i) { int optionID = DPL.GetOptionalContentGroupID(i); DPL.DeleteOptionalContentGroup(optionID); } thanks!
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() 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 |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store