Bookmark Action Parameters

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

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 avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Bookmark Action Parameters

Post by PHK »

What sorts of parameters will Bookmark Actions allow?
image.png
For instance, suppose I want the Bookmark Action to open an existing file but I want it to open with the inherited zoom from the starting file. I tried "%z" and %z but neither worked.

How can I learn more about what parameters can be used in this option box?
You do not have the required permissions to view the files attached to this post.
All best,

FringePhil
User avatar
rakunavi
User
Posts: 1680
Joined: Sat Sep 11, 2021 5:04 am

Re: Bookmark Action Parameters

Post by rakunavi »

Hello PHK,

You probably want to specify the macros that are available in the parameter field of the 'Edit App Launch Parameters' dialog (which can be opened from the Launch Applications category of the Preferences dialog) in the parameter field of the 'Add Action' dialog as well. As far as I know, this is not possible. You will understand this because it would be strange if a macro that works only in PDF-XChange Editor worked when the bookmark was opened in another PDF application that conforms to the PDF specification.

  • figure1.png
As described in the manual, the parameters in the 'Add Action' dialog are passed 'as is' (*) to the application only when the application program is specified as the 'Filename'. Therefore, the options available for the parameters depend on the application program you specify. For example, if you are running the installed version of PDF-XChange Editor and you want to specify the executable program of the portable version of PDF-XChange Editor, then the command line options of PDF-XChange Editor will be applicable.
(*) Even if you specify a macro in the same format as 'Edit App Launch Parameters', the macro will not be expanded.

  • figure2.png
If a document file is specified as the 'Filename', any parameters specified will be ignored.

Please refer to Table 204 on p.423 of the ISO standard for PDF.

  • figure3.png
  • Document management - Portable document format — Part 1: PDF 1.7 (PDF 32000-1:2008)
    https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf
Best regards,
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
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Bookmark Action Parameters

Post by Stefan - PDF-XChange »

Hello rakunavi,

Many thanks for the thorough reply!

@PHK - please let us know if you would need any more input from us! :)

Kind regards,
Stefan
User avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Re: Bookmark Action Parameters

Post by PHK »

I am afraid my limited intellectual capacities inhibit my ability to translate rakunavi's undoubtedly excellent advice into a solution to my prosaic problem.
All best,

FringePhil
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Bookmark Action Parameters

Post by Stefan - PDF-XChange »

Hello PHK,

What Rakunavi says is that those parameters are specific for the application being used, and it is command line parameters that you need to add there. That's why Rakunavi linked to the command line options for the Editor. However you hard coding parameters there might not be ideal.

Have you tried the "Go to a page in another document" instead of the "Open a File" command. Would that work better for you?

Kind regards,
Stefan
User avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Re: Bookmark Action Parameters

Post by PHK »

Tracker Supp-Stefan wrote: Mon Oct 30, 2023 4:12 pm ...
Have you tried the "Go to a page in another document" instead of the "Open a File" command. Would that work better for you?
...
Thank you, Stefan, for that suggestion which (i) I had not been smart enough to try and (ii) works, as well as being much less complicated than trying to deal with 'parameters' however they may work or not.
All best,

FringePhil
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Bookmark Action Parameters

Post by Stefan - PDF-XChange »

:)
User avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Re: Bookmark Action Parameters

Post by PHK »

Is it possible to create a Bookmark Action that executes the Find function with a specific text string parameter?

For instance, I would like a Bookmark Action that finds all the letters"I" on a page where the title of the Bookmark is "I" the way I would if I just used the Find tool and entered I as the search parameter.

Thanking you in advance for any advice.
All best,

FringePhil
User avatar
rakunavi
User
Posts: 1680
Joined: Sat Sep 11, 2021 5:04 am

Re: Bookmark Action Parameters

Post by rakunavi »

Hello PHK,

If you combine several actions, you might be able to achieve something similar to what you want to do.

An example of a combination of the following three actions is shown in the sample file.

  1. Go to a Page in the Document
  2. Execute a Command "Find"
  3. Open a File
  • figure.png

    Animation.gif
In "Open a File" action, I created a script with Autohotkey v1.1 that transfers parameters to the Find dialog of the PDF-XChange Editor, and converted it to an executable file.

Code: Select all

SendMode Input 
ArgCount=%0%
if(ArgCount==0)
	ExitApp
Loop, %ArgCount%
{
	if (A_Index > 1)
		Send {Space}
	Arg := %A_Index%
	Send % Arg
}
Send {Enter}
  • SampleFiles.zip
I have attached the executable file for your reference, but Autohotkey executable files tend to be judged as malicious across the board by anti-virus software and virus checking sites such as Virustotal, so in case you use the executable file as is, you may need to unblock it with anti-virus software. Incidentally, I check all files attached to posts on this forum using VirusTotal and other tools before opening them, and I am very cautious about opening them. If I were in the opposite position, I would never open an executable file. :lol:

  • virustotal.png

    Filename: ParametersTransfer_EXEFile.zip
    Filesize: 402.95 KB (412,624 bytes)
    SHA256: 001320dcf36009121371a5ad3c7a9e53f9215a2825dfbf7ad685a02978256064
  • ParametersTransfer_EXEFile.zip
If it's of any help, I'd be glad.

Best regards,
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
User avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Re: Bookmark Action Parameters

Post by PHK »

Many thanks, rakunavi, for thinking about this and posting a possible solution. It is apparent that you understand what I am trying to achieve. But you were correct in anticipating that my anti-virus software would not permit it to run and I do not know how to overcome that.

The workaround in the current environment is to have just one Action set up (Find) for the Bookmark, hit Rename (F2), then Copy (ctrl-C]), then click on the Bookmark to execute the action, then Paste ([ctrl-V]) , then confirming in the find window that is what you want, and then execute. Or just live without the Bookmark action altogether and simply select the Bookmark, hit F2, hold down the Ctrl key whilst hitting successively the CFV keys (assuming those conventional hot-key assignments), and enter.

This is not meant to be a Feature Request; to be able to string executable Actions with the Bookmarks tool although it would enhance the product functionality somewhat as I do not want to over-challenge DevTeam.
All best,

FringePhil
User avatar
rakunavi
User
Posts: 1680
Joined: Sat Sep 11, 2021 5:04 am

Re: Bookmark Action Parameters

Post by rakunavi »

Hello PHK, thank you for your comments.

In my original script, I had to re-specify the search terms in the "Open a File" Paramters, but with your idea of using the F2 shortcut and the copy and paste shortcut, that extra parameter is no longer necessary! I had not thought of that idea. :o

An example of a combination of the following two actions is shown in the sample file.

  1. Go to a Page in the Document
  2. Open a File
  • figure1.png

    Animation.gif
Here is a Autohotkey v1.1 script for your reference. It is a rather aggressive method, but since PDF JavaScript prohibits access to the clipboard for security reasons, I guess we will have to rely on some kind of external command like this.

Code: Select all

SendMode Input
Send {F2}^a^c{Enter}
Send ^f
Send ^v{Enter}
  • SampleFiles.zip
Sadly, this executable is also determined to be malicious by Virustotal.

  • figure2.png
  • Filename: BookmarkTitleSearch_EXEFile.zip
    Filesize: 402.88 KB (412,557 bytes)
    SHA256: c970a23b9f2711d657dabb71b465ec26f0851bd820b274756e684faa15cd0ef8
  • BookmarkTitleSearch_EXEFile.zip
Best regards,
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
User avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Re: Bookmark Action Parameters

Post by PHK »

Thank you once again, rakunavi, for your further consideration of my challenge. Your script would obviously work, given the simplicity of the task.

However and on balance, I think I will stick to my finger mini-app of {F2 Ctrl-CFV Enter} rather than get involved with trying to defeat my environment's security provisions with all the Unintended Consequences that might arouse.

And if you, rakunavi, could not find a feature in the app that would accomplish this, then I am sure it does not exist.

I conclude that the "Edit Action List" sub-function of Bookmarks is a bit of just-a-tease rather than having any actual functionality. I have not found many functions that users can add for true serial execution.

{ABECF9BF-9F49-4D53-82BB-791B3D1A540C}.png

This business of Adding actions that the app seems to be offering is a bit illusory, as whatever you add probably won't actually execute. But I would also understand that DevTeam would not want to waste any resources on paring it down to avoid fueling user expectations. Maybe sometime in the distant future, the Edit Action List will have the functionality its presence implies.
You do not have the required permissions to view the files attached to this post.
All best,

FringePhil
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7361
Joined: Wed Mar 25, 2009 10:37 pm

Re: Bookmark Action Parameters

Post by Paul - PDF-XChange »

Hi, PHK

sorry for the delay in getting back to you.

After reading and rereading the thread I am afraid I am not actually clear on what kind of action you are wanting. There are only a limited number of actions defined in the PDF specifications.

May I ask you to humour me and explain exactly what kind of action you are expecting but not getting.

I feel like I am being obtuse here, but I need clarification please mate.
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
User avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Re: Bookmark Action Parameters

Post by PHK »

What I want is simple. I would like to have the Rename function added to the Bookmarks Action List as an executable command.

Then, to have Bookmarks Actions to execute sequentially the Actions as in this List finally showing the results as usual in a "Find" operation.

{3C4825DB-C9F0-4DC9-B4CC-B1A65EA9BB60}.png

Example: I have a Bookmark with the Title "Test". I want to see where the text string "Test" appears on the page. What I must do now is hit F2 to activate the Rename action, then Ctrl-C to copy that title string of text, hit Ctrl-F to activate the Find action, hit Ctrl-V to paste the text string into the Find mini-window, and finally hit the Enter key. I want to be able to do that all just by clicking on the Bookmark.
You do not have the required permissions to view the files attached to this post.
All best,

FringePhil
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7361
Joined: Wed Mar 25, 2009 10:37 pm

Re: Bookmark Action Parameters

Post by Paul - PDF-XChange »

Hi, PHK

does not the bookmark itself point to the location where that text is? What does the bookmark point to if not the text it describes?

A bookmark action is an action taken when the bookmark is clicked. If "Rename" was a Bookmark action, then clicking it would not act as a bookmark and take you to some resource, but instead offer to rename it?

I must be misunderstanding what you want still, because "Rename" isn't any kind of destination. I do not believe it would be supported by other PDF applications, which breaks the P in PDF.

Am I missing a key point here? How does "Rename" lend itself to a bookmark action?
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
User avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Re: Bookmark Action Parameters

Post by PHK »

I want a Bookmark that, when clicked, finds all the text strings of that Bookmark title on the current page. Think of it as a Bookmarked key word. I set up a Bookmark with the key word as the title of the Bookmark. Then, every time I want to see where that key word is in the document all I would have to do is hit the respective Bookmark.
PHK wrote: Wed Sep 18, 2024 10:04 pm What I want is simple. I would like to have the Rename function added to the Bookmarks Action List as an executable command.

Then, to have Bookmarks Actions to execute sequentially the Actions as in this List finally showing the results as usual in a "Find" operation....
The purpose of the F2 action is not to rename the Bookmark but rather to select the text string of the Bookmark title and 'conveying' that string to the Find function. If there is another way, that would be fine.

It would look like this:
{93E74F5D-29D3-45B6-B6B1-F78BF9DE3A14}.png


It is not a destination but rather a compound set of actions. There are many other actions that a Bookmark can trigger; this is just one more.

If this is too difficult to conceptualize or implement as I am beginning to suspect it is, no problem. As I wrote above, I can live with my finger mini-app of {F2 Ctrl-CFV Enter}.
You do not have the required permissions to view the files attached to this post.
All best,

FringePhil
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11052
Joined: Wed Jan 03, 2018 6:52 pm

Re: Bookmark Action Parameters

Post by Daniel - PDF-XChange »

Hello, PHK

Thank you for the extended explanation, I am still unsure, like Paul was, if rename is something allowed to be present in the bookmark data specifically, but I have passed this suggestion up to the dev team, perhaps they will have another solution. For now, I cannot make any promises.

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
User avatar
PHK
User
Posts: 1398
Joined: Tue Nov 24, 2020 4:02 pm

Re: Bookmark Action Parameters

Post by PHK »

Thanks for taking the time to look into this for us and I hope it is doable.
All best,

FringePhil
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Bookmark Action Parameters

Post by Stefan - PDF-XChange »

:)