If you use Shell Menu for more than one file, their order after merging may be mixed up

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools.

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Stefan - PDF-XChange

User avatar
Jensen Head
User
Posts: 581
Joined: Mon Sep 13, 2021 8:12 am

If you use Shell Menu for more than one file, their order after merging may be mixed up

Post by Jensen Head »

I did a little experiment processing two files to merge them into PDF:

1. Selected the first file, then added the second file to the selection, then right-clicked on the first file and ran the merge operation via Shell Menu.
2. Selected the first file, then added the second file to the selection, then right-clicked on the second file (…).
3. Selected the second file, then added the first file to the selection, then right-clicked on the first file (…).
4. Selected the second file, then added the first file to the selection, then right-clicked on the second file (…).
5. Pressed Ctrl+A, pressed the keyboard context menu button (…).

Expected result: in all cases, the resulting PDF file has pages sorted by the name of the original files.

Actual result: the page order depends on which file was right-clicked. Given this, the result of point 5 is unpredictable without a thorough knowledge of how it works internally, which is completely redundant for the user to know.

I suggest that in case of using Shell Menu, always sort input files by full name (including path), or add a corresponding setting to the Choose Input Files module.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19856
Joined: Mon Jan 12, 2009 8:07 am

Re: If you use Shell Menu for more than one file, their order after merging may be mixed up

Post by Stefan - PDF-XChange »

Hello Jensen Head,

When using the Shell Menu, it is actually Windows that prepares and sends the list of documents to us for processing, and how they will order that list is beyond our control, so if you want a specific order - then you will need to open the Editor and arrange the files in the respective dialogue inside the Editor UI.

Kind regards,
Stefan
User avatar
Jensen Head
User
Posts: 581
Joined: Mon Sep 13, 2021 8:12 am

Re: If you use Shell Menu for more than one file, their order after merging may be mixed up

Post by Jensen Head »

The presence of the "Keep output documents in order according to input data" [1] setting in the Tool Options dialog, which can take the values ​​"Auto", "Yes" and "No", suggests that PDF-Tools has some control over the order of documents. At least in the output. Maybe this issue could be considered as a proposal to add the action for sorting of files added via the "Choose Input Files" action?

[1] This option determines whether output files are saved in an order that corresponds with their input order. This option is only available when the 'Batch Processing Mode' option is disabled and the 'Multi-Threaded Processing' option is enabled.
Note: disabling this feature may improve the performance of the application and reduce the resources it uses, but the output order of documents may not match the input order in that case.
Auto — application will decide automatically whether or not retaining the input order of documents is necessary.
Yes — retain the input order of documents.
No — do not retain the input order of documents.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11021
Joined: Wed Jan 03, 2018 6:52 pm

Re: If you use Shell Menu for more than one file, their order after merging may be mixed up

Post by Daniel - PDF-XChange »

Hello, Jensen Head

I think you have drawn an inverse correlation there... This option refers to how our output action works. It allows the output to respect the specific order in which files passed through the input option. In most cases, this is intended to be used with the "file list" function, for optimal results (see last paragraph).
There is no indication here that other input methods are able to control the processing order, only that the tool records the input order.

This option mostly exists for tools where you may be running a process on dozens of files, and need control over the output order.
For example OCR pages is not something this would normally be important for. If you are processing 15 documents, and the first that gets processed is 1000 pages long, while the remaining 14 are all 5 pages or less, you would not want tools to "hold" processing (or, saving, as it were) the other 14, while the first is in progress, because it will take dozens of times as long, as the others would.
  • If you have this disabled, when document 2 finishes processing, this option tells the tool, "it is okay to save that file immediately, and begin processing the next one out of order".
  • Instead, If it is enabled, then document 2 will sit and patiently wait for document 1 to be saved, before it saved document 2. This second case can be important for situations where you are renaming files, and need the output to be numbered reflecting the processing order.
Moving a bit back to the main topic, if you use the "file list" function (create a text file, with 1 path per line, then save that file with a "*.PDTFL" file extension), PDF-Tools will request the files "one-by-one", in the listed order. This is the most reliable way to ensure your files are processed in a specific order, if that is necessary.

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