When Collapse All is executed in Bookmarks pane, bookmarks with no children are unintentionally set to closed

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
User avatar
rakunavi
User
Posts: 871
Joined: Sat Sep 11, 2021 5:04 am

When Collapse All is executed in Bookmarks pane, bookmarks with no children are unintentionally set to closed

Post by rakunavi »

Hello all,

I have found that when using the "Collapse All" of the Bookmarks pane in the PDF-XChange Editor, the collapsed state of all bookmark entries is set to closed, regardless of whether they have children or not. The effect is limited to the time until the file is closed. When the file is reopened, the collapsed state of the bookmarks without children will be set back to open. Therefore, bookmark tree operations and exporting to a text file are affected after the Collapse All is executed. Even if the Collapse All is not executed, importing the affected text file (with all items set to closed) will set the collapsed state of all bookmark items to closed.

Users cannot determine whether the collapsed state of a bookmark with no children is set to closed or open by looking at the Bookmarks pane or properties; only by exporting the bookmarks to a text file. Thus, if the user moves a bookmark item to establish a parent-child relationship before executing the Collapse All feature, the tree will appear expanded, but if the same tree operation is performed after the Collapse All is executed and before the file is closed, the tree will appear collapsed.

If users are not aware of this background, they may be confused: compared to other PDF editing software such as Acrobat, which always keeps the collapsed state of bookmark items without children open, even when using the Collapse All feature, this may seem like a bug in PDF-XChange Editor.

Please refer to the following verification procedure and see attached verification video for more details. The corresponding timecode in the video is also included.
([MM:SS] "MM" shows minutes, and "SS" shows seconds.)

  • [00:00] Open the PDF version of the online manual PDFXE9_MAN.pdf and execute the "Export Bookmarks to Text File" feature.
    [00:14] Notice that only bookmark items with children have a "closed" option.

    Code: Select all

    Table of Contents; 3
    Welcome; 12
    Installation; closed; 15
    	System Requirements; 17
    	Switches for MSI Installers; 18
    	Switches for EXE Installers; 30
    	Licensing; 36
    	End User License Agreement; 47
    	The Tracker Updater; 61
    Features Overview; 66
    Explore the User Interface; 74
    Operations Guide ; closed; 82
    	Annotations Guide; 83
    
    [00:22] If you change the structure of the bookmark tree, the tree will be expanded and displayed as if it is hanging below the parent bookmark.
    [00:28] Close the file without saving it.
    [00:32] Open the file, perform the Collapse All in the options menu of the Bookmarks pane(*), and then save the file.
    [00:44] Execute the "Export Bookmarks to Text File".
    [00:54] Notice that all lines have a "closed" option.

    Code: Select all

    Table of Contents; closed; 3
    Welcome; closed; 12
    Installation; closed; 15
    	System Requirements; closed; 17
    	Switches for MSI Installers; closed; 18
    	Switches for EXE Installers; closed; 30
    	Licensing; closed; 36
    	End User License Agreement; closed; 47
    	The Tracker Updater; closed; 61
    Features Overview; closed; 66
    Explore the User Interface; closed; 74
    Operations Guide ; closed; 82
    	Annotations Guide; closed; 83
    
    [01:02] If you change the structure of the bookmark tree, the tree will be collapsed.

    • If it does not reproduce the problem shown, please execute Collapse All twice in (*). If you only run Collapse All once, it is very rare that the bookmarks is not collapsed when you change the tree structure.
    [01:08] Save and close the file.
    [01:12] Open the file and execute the "Export Bookmarks to Text File".
    [01:23] Notice that only bookmark items with children are closed.

    Code: Select all

    Table of Contents; 3
    Welcome; 12
    Installation; closed; 15
    	System Requirements; 17
    	Switches for MSI Installers; 18
    	Switches for EXE Installers; 30
    	Licensing; 36
    	End User License Agreement; 47
    	The Tracker Updater; 61
    Features Overview; 66
    Explore the User Interface; 74
    Operations Guide ; closed; 82
    	Annotations Guide; 83
    
    [01:31] If you change the structure of the bookmark tree, the tree will be expanded and displayed as if it were hanging below the parent bookmark.
For reference, by applying the following script, you can set only bookmark items with children to "closed" state, just like the general Collapse All feature.

Code: Select all

var TargetLevel = 0;

function CollapseLevel(bkm, nLevel) {
	if (bkm.children != null)
		for (var i = 0; i < bkm.children.length; i++) {
			if (bkm.children[i].children == null)
				bkm.children[i].open = true;
			else {
				if (nLevel >= TargetLevel)
					bkm.children[i].open = false;
				else
					bkm.children[i].open = true;
				CollapseLevel(bkm.children[i], nLevel + 1);
			}
		}
}
CollapseLevel(this.bookmarkRoot, 0);
Hoping that the above information will be of some help to you.
Thank you so much for your continued support.

Best regards,
rakunavi

- PDF-XChange Editor Plus Version: 9.5 build 366.0
- OS Version: Windows 11 Home 22H2 Build 22621.1105
- PC Model: Lenovo IdeaPad C340-15IWL, HP All-in-One 22-c0xx
Last edited by rakunavi on Thu Jan 26, 2023 5:45 am, edited 1 time in total.
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
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: When Collapse All is executed in Bookmarks pane, bookmarks with no children are unintentionally set to closed

Post by TrackerSupp-Daniel »

Hello, rakunavi

Thank you for the report, I will pass this input along to the dev team, but I believe that this is just a simple difference in how we choose to respect the actions that our users are performing, close all, in our context means close all , not only those which have children below them.
I do not expect that this will be changing, and to be quite honest, I am more than a little perplexed that you even managed to find this difference unless you were explicitly looking for it.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) 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 avatar
rakunavi
User
Posts: 871
Joined: Sat Sep 11, 2021 5:04 am

Re: When Collapse All is executed in Bookmarks pane, bookmarks with no children are unintentionally set to closed

Post by rakunavi »

Hi Daniel, thank you for your comment.
TrackerSupp-Daniel wrote: Mon Jan 23, 2023 7:14 pm I am more than a little perplexed that you even managed to find this difference unless you were explicitly looking for it.
I didn't specifically look for it, I think users with some familiarity with PDF software will notice this level of difference. But, I guess it just means that no one is stupid enough to take up their precious time to report it like I did.

Even though it is too small a problem, I have reported it because I have yet to see a behavior like Collapse All in PDF-XCE in any other software. I made the same mistake in a script I wrote the other day and just fixed it.

  • https://forum.pdf-xchange.com/viewtopic.php?p=166615#p166615
It should only take a few minutes to fix if the programmer is willing to fix it.

Best regards,
rakunavi
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
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: When Collapse All is executed in Bookmarks pane, bookmarks with no children are unintentionally set to closed

Post by TrackerSupp-Daniel »

Hello, rakunavi

We shall have to wait and see what they do, thank you for reporting the issue in any case though.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply