Join PDF-Files in special order  SOLVED

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

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

Post Reply
Nimrod_189
User
Posts: 35
Joined: Wed Sep 23, 2009 8:39 am

Join PDF-Files in special order

Post by Nimrod_189 »

Hello folks,

I would like to join several files with the PDF-Tools and automatically insert bookmarks. However, the order specified by me should be strictly adhered to.

As I understand it, I am not allowed to select batch processing and it is mandatory to select several CPUs. Unfortunately, my setting doesn't work, only one file is used at a time.

What am I doing wrong?
Can someone tell me how to set the setting correctly?


Here my job:
Screenshot 2023-03-10 194115.png

Files with default sorting by name in windows explorer:
Screenshot 2023-03-11 075507.png

My sorted list:

"E:\Users\ama\Temp\PDFTools\Compress\Test_1.pdf E:\Users\ama\Temp\PDFTools\Compress\PDF_2.pdf E:\Users\ama\Temp\PDFTools\Compress\Test_WU.pdf E:\Users\ama\Temp\PDFTools\Compress\PDF_3.pdf E:\Users\ama\Temp\PDFTools\Compress\Test_QR.pdf"

The files should be merged exactly in this order (with Bookmarks).

I will do it in a VBNet-programm:

Code: Select all

    Public Function JoinPDFBookmark(sourceFiles As List(Of String), sTargetFile As String) As Boolean
10:     Dim p As New Process
20:     Dim sSource As String = ""
        'Dim sTargetPath As String = System.IO.Path.GetDirectoryName(sourceFiles(0))
        'https://help.pdf-xchange.com/pdfxt9/index.html?command-line-options_t.html


200:    For Each s As String In sourceFiles
210:        sSource = sSource & Add_Qouted(s) & " "
220:    Next
230:    sSource.TrimEnd()
        If File.Exists(sTargetFile) Then System.IO.File.Delete(sTargetFile)

240:    Try
250:        p.StartInfo.FileName = "C:\Program Files\Tracker Software\PDF Tools\PDFXTools.exe"
260:        p.StartInfo.Arguments = "/RunTool {B404A7F2-BA30-46B9-865E493B71EC558D} " & sSource   'JoinPDFBookmark
270:        p.Start()
280:        p.WaitForExit()
290:        p.Close()
300:        Dim _Source() As String = System.IO.Directory.GetFiles(TmpPathTarget)

310:        System.IO.File.Move(_Source(0), sTargetFile)
320:        Return True
330:    Catch
340:        Return False
350:    End Try

    End Function

I hope anyone can help me. :roll:

Thanks.

Nimrod
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Join PDF-Files in special order  SOLVED

Post by TrackerSupp-Daniel »

Hello, Nimrod_189

When you simply specify a folder location, we are at the mercy of the order which windows processes and forwards the files to us. Usually this is in alphabetical (or the most recently sorted) order, but on occasion windows will process one or two out of order simply because they are smaller or better optimized. If you need them to be opened in a specific order, use the "File list" function instead, which should allow you to create a text file with the ( *.PDTFL ) file extension that simply contains a list of the paths to each file you wish to process, in your specified order, like so.
image.png
This will ensure that the files are processed in this order, and allow the split merge to occur as needed.

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
Nimrod_189
User
Posts: 35
Joined: Wed Sep 23, 2009 8:39 am

Re: Join PDF-Files in special order

Post by Nimrod_189 »

Hi Daniel,

You have misunderstood me. I don't want to join all files in a folder. Rather, I list all the necessary files in a predetermined order and I want to pass this list on to the PDF tools. It always worked before an update, but suddenly it didn't anymore.

It's not about opening PDF files for me either, but about merging several PDF files into one and the bookmarks should also be set at the same time.

Nimrod
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Join PDF-Files in special order

Post by TrackerSupp-Daniel »

Hello, Nimrod_189

I did understand, but the merge operation is highly dependant on the "open order" from the previous action. This is why the file list option is what you will need to use. Once the file list is in place, the files will be opened in the correct order, and with that, the "merge files" step will process the files in that specific order (ensuring that they are organized as desired. Then you will find that the bookmarks are added as defined by the settings:
image.png
In order for these to work as you desire, you need to first address the issue with your file selection method in the first step of the process.
image(1).png
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
Nimrod_189
User
Posts: 35
Joined: Wed Sep 23, 2009 8:39 am

Re: Join PDF-Files in special order

Post by Nimrod_189 »

Thank you for your help.

Will there ever be a way that I can choose the order myself?

Another question on this topic:

Can I add the bookmarks later using a batch command?
I also use IText, so I can easily determine the number of pages per file and can thus set the bookmarks. I already do the joining with Itext myself.

Nimrod
Nimrod_189
User
Posts: 35
Joined: Wed Sep 23, 2009 8:39 am

Re: Join PDF-Files in special order

Post by Nimrod_189 »

I found the solution myself.

It seems so easy.
The export of bookmarks shows me the file structure and it's really simple.

I'll test it out at leisure.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Join PDF-Files in special order

Post by TrackerSupp-Daniel »

:)
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
Nimrod_189
User
Posts: 35
Joined: Wed Sep 23, 2009 8:39 am

Re: Join PDF-Files in special order

Post by Nimrod_189 »

Hi Daniel,
TrackerSupp-Daniel wrote: Mon Mar 13, 2023 4:25 pm Hello, Nimrod_189

When you simply specify a folder location, we are at the mercy of the order which windows processes and forwards the files to us. Usually this is in alphabetical (or the most recently sorted) order, but on occasion windows will process one or two out of order simply because they are smaller or better optimized. If you need them to be opened in a specific order, use the "File list" function instead, which should allow you to create a text file with the ( *.PDTFL ) file extension that simply contains a list of the paths to each file you wish to process, in your specified order, like so.
image.png
This will ensure that the files are processed in this order, and allow the split merge to occur as needed.

Kind regards,


Now I have understood the principle of the pdtfl file list and it absolutely fulfills my idea. That's exactly what I need, so my problem is solved. :idea:

Thank you for the really great program. :D

Nimrod
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Join PDF-Files in special order

Post by TrackerSupp-Daniel »

Hello, Nimrod_189

I had a hunch that it would be the solution, Sorry for not explaining it clearly enough here, but I am quite glad you were able to take advantage of 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
Post Reply