Delete all children bookmarks
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 558
- Joined: Sat Dec 16, 2023 11:09 am
Delete all children bookmarks
Hi,
There's an option to Delete but Retain Children bookmark but I can't find a Delete all children bookmarks feature.
Looking for the opposite of that feature
Is this not yet supported ?
Edit : I noticed that it was requested a long time ago in this post so it's not supported
Thanks for considering this,
There's an option to Delete but Retain Children bookmark but I can't find a Delete all children bookmarks feature.
Looking for the opposite of that feature
Is this not yet supported ?
Edit : I noticed that it was requested a long time ago in this post so it's not supported
Thanks for considering this,
You do not have the required permissions to view the files attached to this post.
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
-
- Site Admin
- Posts: 7360
- Joined: Wed Mar 25, 2009 10:37 pm
Re: Delete all children bookmarks
Hi, Loki@99
It's just "delete". That deletes the bookmark and it's children.
There is no option for delete just the children.
Can you not simply select those children and delete of you want to retain the parent?
It's just "delete". That deletes the bookmark and it's children.
There is no option for delete just the children.
Can you not simply select those children and delete of you want to retain the parent?
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 558
- Joined: Sat Dec 16, 2023 11:09 am
Re: Delete all children bookmarks
Hi Paul,
The issue is that there are too many children that I want to delete while retaining the parent so it will be very time consuming. Especially with my 12.6 inch device.
For e.g, I would like to delete all level 3 "Question" bookmark in the following file. As you can see in the following GIF, there are many "Question" bookmark
GIF
Having a feature for deleting children bookmarks will drastically speed up the process.
Like this
Paul - Tracker Supp wrote: ↑Mon Sep 23, 2024 8:40 pm Can you not simply select those children and delete of you want to retain the parent?
The issue is that there are too many children that I want to delete while retaining the parent so it will be very time consuming. Especially with my 12.6 inch device.
For e.g, I would like to delete all level 3 "Question" bookmark in the following file. As you can see in the following GIF, there are many "Question" bookmark
GIF
Having a feature for deleting children bookmarks will drastically speed up the process.
Like this
You do not have the required permissions to view the files attached to this post.
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
-
- User
- Posts: 1673
- Joined: Sat Sep 11, 2021 5:04 am
Re: Delete all children bookmarks
Hello Loki@99,
Not the direct way you are looking for, but it would be easiest to export the bookmarks once to a text file, open it in a text editor that can handle regular expressions, bulk replace the parts you want to delete, and import it again in the PDF-XChange Editor.
Another way, again not the one you are looking for, is to use JavaScript to remove it. It is less flexible than the method using a text editor, but can be deleted in an instant.
Best regards,
rakunavi
Not the direct way you are looking for, but it would be easiest to export the bookmarks once to a text file, open it in a text editor that can handle regular expressions, bulk replace the parts you want to delete, and import it again in the PDF-XChange Editor.
Another way, again not the one you are looking for, is to use JavaScript to remove it. It is less flexible than the method using a text editor, but can be deleted in an instant.
Code: Select all
function deleteBookmarks(bm, level) {
if (bm.children != null) {
for (var i = bm.children.length - 1; i >= 0; i--) {
deleteBookmarks(bm.children[i], level + 1);
}
}
if (level == 4) {
bm.remove();
}
}
for (var i = 0; i < this.bookmarkRoot.children.length; i++) {
deleteBookmarks(this.bookmarkRoot.children[i], 1);
}
rakunavi
You do not have the required permissions to view the files attached to this post.
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
-
- User
- Posts: 558
- Joined: Sat Dec 16, 2023 11:09 am
Re: Delete all children bookmarks
Hi
@rakunavi
Thank you for your help. Your tips indeed work but it's a bit too technical for me as I'm not fluent with those regular expressions and JavaScript stuff.
The issue is that I have many other files which I need to delete children bookmarks.
I hope that Tracker Support will take a look at this as @Sasha said in the old post.
@rakunavi
Thank you for your help. Your tips indeed work but it's a bit too technical for me as I'm not fluent with those regular expressions and JavaScript stuff.
The issue is that I have many other files which I need to delete children bookmarks.
I hope that Tracker Support will take a look at this as @Sasha said in the old post.
If a Delete but retain children feature exists, it would make sense that the opposite feature Delete children only existsa as well.Sasha - Tracker Dev Team wrote: ↑Thu May 02, 2019 8:53 am This is a reasonable suggestion - we'll try to add such a command that will remove children of the selected bookmarks.
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
-
- Site Admin
- Posts: 11031
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Delete all children bookmarks
Hello, Loki@99
I have followed up with Sasha about this to see what happened with that task. If a new ticket ends up made, I will post that here.
RT#7123: FR: Add "Delete All Children bookmarks" function.
Kind regards,
I have followed up with Sasha about this to see what happened with that task. If a new ticket ends up made, I will post that here.
RT#7123: FR: Add "Delete All Children bookmarks" function.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 571
- Joined: Thu Jun 19, 2014 7:30 pm
Re: Delete all children bookmarks
In the mean time, here's a tool I made to delete bookmark children.
Extract the zip file and save in the Javascripts folder. On restart, it will add a button to the bookmarks toolbar:
It opens a dialog listing all the current bookmarks: If you select a parent bookmark, and press the [Delete] button in the lower left corner, it will mark the children of that bookmark for deletion. When you are done picking bookmark children to delete, press OK. Nothing is actually deleted until you press OK - so if you cancel, everything is left unharmed.
Extract the zip file and save in the Javascripts folder. On restart, it will add a button to the bookmarks toolbar:
It opens a dialog listing all the current bookmarks: If you select a parent bookmark, and press the [Delete] button in the lower left corner, it will mark the children of that bookmark for deletion. When you are done picking bookmark children to delete, press OK. Nothing is actually deleted until you press OK - so if you cancel, everything is left unharmed.
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 558
- Joined: Sat Dec 16, 2023 11:09 am
Re: Delete all children bookmarks
Hi Mathew,
Thanks for making that great tool.
Is it possible that you add a collapse-expand feature inside so that there's no need to scroll through all bookmarks ? I sometimes deal with +2000 bookmarks. A multiple selection feature will be great as well.
GIF
Issue - No expand or collapse
I also noticed that it always redirects to the first bookmark after clicking "Delete" which reduces productivity
GIF - Clicking "Delete" always redirect to the first bookmark
Thank you,
You do not have the required permissions to view the files attached to this post.
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
-
- Site Admin
- Posts: 11031
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Delete all children bookmarks
Hello, Loki@99
Just a quick followup, A ticket has been made, so we can expect this feature in the future:
RT#7123: FR: Add "Delete All Children bookmarks" function.
Kind regards,
Just a quick followup, A ticket has been made, so we can expect this feature in the future:
RT#7123: FR: Add "Delete All Children bookmarks" function.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 571
- Joined: Thu Jun 19, 2014 7:30 pm
Re: Delete all children bookmarks
OK, try this version: I added the ability to expand/collapse the bookmarks. There are two problems with the dialog that javascript can make:Loki@99 wrote: ↑Thu Sep 26, 2024 5:39 am Is it possible that you add a collapse-expand feature inside so that there's no need to scroll through all bookmarks ? I sometimes deal with +2000 bookmarks. A multiple selection feature will be great as well.
I also noticed that it always redirects to the first bookmark after clicking "Delete" which reduces productivity
- I don't think there's a built-in way to do multiple selections in a list_box. I made a rudimentary version: (select the first row, then the check box at the bottom of the dialog, then it will select all rows between that first row and whichever row you select next). The problem is that in order to change how the selected row looks, it will scroll back up to the top each time you change the multiple selection... It marks the selected rows with [ square brackets ]. I've found that using the up/down arrow keys may be easier... Once you have all the rows you want selected, press "Delete" and it will apply to all of them.
- Every time javascript changes the contents of the list_box, it resets to the top, even though the selection is way down the list. Would be nice to be able to get/set scroll position, or at least for PXE to remember the last position...
Code: Select all
"FRA": {
"Delete Children": "Supprimer Enfants",
" [%1 children to delete]": [" [%1 enfant à supprimer]"," [%1 enfants à supprimer]"],
"Delete Child Bookmarks": "Supprimer les signets enfants",
"Select bookmark and press [Delete] to delete children:": "Sélectionnez le signet et appuyez sur [Supprimer] pour supprimer les enfants :",
"Expand All": "Développer Tout",
"Collapse All": "Réduire Tout",
"Expand/Collapse": "Développer/Réduire",
"Delete": "Supprimer",
"Select Range": "Sélectionnez Plusieurs",
"There are no bookmarks!": "Il n'y a pas de signets !",
"User cancelled": "Utilisateur annulé"
}
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 558
- Joined: Sat Dec 16, 2023 11:09 am
Re: Delete all children bookmarks
Hi all,
Thanks the the ticket.
Looking forward for PDFXCE native feature,
Kind regards,
@Mathew Thanks for the tool update. Expand/collapse feature and the range selection work as intended. I don't have PDFXCE interface language set to french but thanks for the translation.
@DanielTrackerSupp-Daniel wrote: ↑Thu Sep 26, 2024 3:28 pm Just a quick followup, A ticket has been made, so we can expect this feature in the future:
RT#7123: FR: Add "Delete All Children bookmarks" function.
Thanks the the ticket.
Looking forward for PDFXCE native feature,
Kind regards,
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
-
- User
- Posts: 558
- Joined: Sat Dec 16, 2023 11:09 am
Re: Delete all children bookmarks
Hi,
For some reason, the script doesn't work when deleting the following range with this file Select range Item 302 to Item 350 in Entraînement > Vignettes cliniques > Enoncés et questions
GIF
As you can see, bookmarks child are still there
Thanks for investigating,
For some reason, the script doesn't work when deleting the following range with this file Select range Item 302 to Item 350 in Entraînement > Vignettes cliniques > Enoncés et questions
GIF
As you can see, bookmarks child are still there
Thanks for investigating,
You do not have the required permissions to view the files attached to this post.
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
-
- User
- Posts: 571
- Joined: Thu Jun 19, 2014 7:30 pm
Re: Delete all children bookmarks
@Loki@99 I think I found the bug and squashed it in v0.4 below. Thanks for the help and sample file.
**Edit** I found another bug in displaying multiple bookmarks with the same name. I don't think anyone downloaded yet, so here's v0.4.1 I've also added a workaround for the way it keeps scrolling back up to the top - but it's a bit weird. I've turned it off on the one I use because I can't get used to not using the scroll wheel, but it does make deleting multiple rows less frustrating.
There are some settings that you can change on lines 34-38.
- Set line 34 to the maximum number of lines to show at a time. I've set it to 20. If you set it to 0 then it will just use regular scrolling
- Set line 35 to false to leave all bookmarks expanded when you open the dialog
- Lines 36-38 are the spacers used on the front to indent child bookmarks, and show whether they are open or closed
Code: Select all
33 const dcbPrefs = {
34 listboxMaxlen: 20, // set to 0 to use scrolling
35 openCollapsed: true, // set to true to open the dialog with all bookmarks collapsed
36 pSpace: " ", // to space out lower levels in list box
37 pOpen: "\u02C5 ", // mark for open parent \u25BC
38 pClose: "> ", // mark for closed parent \u25BA
39 };
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 558
- Joined: Sat Dec 16, 2023 11:09 am
Re: Delete all children bookmarks
Hi Mathew,
I can confirm that the bookmarks range issue I reported is fixed in 0.4.1.
I also disabled your workaround for the scrolling back up to the top issue as I scroll with a touchscreen device.
You're welcome. Thanks for updating the script.Mathew wrote: ↑Sat Sep 28, 2024 12:35 am @Loki@99 I think I found the bug and squashed it in v0.4 below. Thanks for the help and sample file.
**Edit** I found another bug in displaying multiple bookmarks with the same name. I don't think anyone downloaded yet, so here's v0.4.1
I've also added a workaround for the way it keeps scrolling back up to the top - but it's a bit weird. I've turned it off on the one I use because I can't get used to not using the scroll wheel, but it does make deleting multiple rows less frustrating.
I can confirm that the bookmarks range issue I reported is fixed in 0.4.1.
I also disabled your workaround for the scrolling back up to the top issue as I scroll with a touchscreen device.
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
-
- Site Admin
- Posts: 2207
- Joined: Mon Jan 15, 2018 9:01 am
-
- User
- Posts: 571
- Joined: Thu Jun 19, 2014 7:30 pm
Re: Delete all children bookmarks
This tool is no longer needed as of (at least) Build 393, so if you have a recent version, it's better to just delete bkmDeleteChild.js from the Javascripts folder. But I ran into an issue where if this script was still installed, it was causing problems with other scripts if they did not have 1ang.js installed. So I've made a fixed version below:
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 11031
- Joined: Wed Jan 03, 2018 6:52 pm
Delete all children bookmarks

Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com