Some questions regarding the cmd line operations

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

adamp
User
Posts: 4
Joined: Tue Mar 24, 2020 11:56 pm

Some questions regarding the cmd line operations

Post by adamp »

Hello,

Please clarify how to use PDF-Tools to execute some sequence of operations (converting, merging, put the comments into the files and so on) from the command line, using relative pointing of files and folders? In "Command Line Options" chapter of the online manual I found the "relative" word in three locations (and it is related there to filenames and folders) - but unfortunately without any explanation or examples. Now I'm suspecting that the relative file & folders addressing is not supported by the tools.

I understand that the UI version of the PDF-Tools do not need the relative addressing of the files - it have tons of ways to point input files and so on - but in absolute addressing manner.

The other situation is with the operation executed from the cmd line.
I have the idea to use some script file which will be manipulate the files using PDF-Tools in completely silent mode, without any interaction with the user. It could be done using scripting to call the PDF-Tools with absolute addressed inputs/output files. But this means additional hours spent to program this workaround. So, my question is: how to address files and folders in the relative manner?

And the second questions:
Is it possible to call some tool (like header& footer) passing to it some needed arguments (to avoid configuring the tools in UI mode)?

Best regards
Adam
adamp
User
Posts: 4
Joined: Tue Mar 24, 2020 11:56 pm

Re: Some questions regarding the cmd line operations

Post by adamp »

And the third question :-)
Where can I find the detailed explanation, how to call, for example Header&Footer tool, from the cmd line? And of course other tools...

Best regards
Adam
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6903
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada

Re: Some questions regarding the cmd line operations

Post by Paul - Tracker Supp »

Hi Adam,

I assume you are referring to this page regards the documentation of the PDF-Tools command line functionality?
https://help.pdf-xchange.com/pdfxt ... ons_t.html
<filename> means full or relative path to file. When the path contains white spaces it should be enclosed in quotation marks. For example: c:\MyDocuments\MyTestDocument.pdf should be "c:\My Documents\My Test Document.pdf".
So you should be able to use both, relative and absolute paths. When in doubt, use a full path.

To my mind this is all we currently have available for PDF-Tools commands.

You asked:
Is it possible to call some tool (like header& footer) passing to it some needed arguments (to avoid configuring the tools in UI mode)?
I don't believe so, you need to create the tools using the GUI then you can call them from the command line.
Is that what you are asking?

I hope that helps.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
Vladimir G - Tracker Dev
User
Posts: 41
Joined: Thu Nov 30, 2017 1:24 pm

Re: Some questions regarding the cmd line operations

Post by Vladimir G - Tracker Dev »

Hello, Adam
Please clarify how to use PDF-Tools to execute some sequence of operations (converting, merging, put the comments into the files and so on) from the command line, using relative pointing of files and folders?
PDF-Tools supports relative paths for input files, and /Output command's "folder" option.

For example:

Code: Select all

С:\> "C:\Program Files\Tracker Software\PDF Tools\PDFXTools.exe" /RunTool pdft.tool.addHeaderAndFooter RelativePath\File.pdf /Output:folder="RelativePath\Tool Result"
Note, that relative path is calculated from folder where you start PDF-Tools, not from folder where PDF-Tools is located.

For example, if you call:

Code: Select all

C:\Documents\>"C:\Program Files\Tracker Software\PDF Tools\PDFXTools.exe" /RunTool pdft.tool.addHeaderAndFooter RelativePath\File.pdf /Output:folder="RelativePath\Tool Result"
Full path for File.pdf will be "C:\Documents\RelativePath\File.pdf", and result will be stored in "C:\Documents\RelativePath\Tool Result" folder.
Is it possible to call some tool (like header& footer) passing to it some needed arguments (to avoid configuring the tools in UI mode)?
Unfortunately, you cannot pass arguments for Tool's Actions via Command Line.
For now, there are no solution or workaround to do this if you want to determine needed arguments on fly during script run.

But, keep in mind using Import/Export Tools feature and /ImportTool Command Line option, it might help if you will be satisfied using several pre-configured Tools.
Where can I find the detailed explanation, how to call, for example Header&Footer tool, from the cmd line? And of course other tools...
All explanations and examples you can find on link https://help.pdf-xchange.com/pdfxt8/ in Appendix -> Command Line Options section.

In short, to run any Tool from command line you should use /RunTool option and pass Tool ID as it's argument.

Example for "Add Header and Footer" Tool:

Code: Select all

PDFXTools.exe /RunTool pdft.tool.addHeaderAndFooter File1.pdf File2.pdf
You can get Tool ID:
1. Using Command Line option /DumpTools
2. Right-click on Tool in UI, choose "Copy Tool Identifier". Tool ID will be copied to clipboard.
Vladimir Goshko
Software Developer
Tracker Software Products