Javascripts via PDF Tools

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

dustinbagley
User
Posts: 22
Joined: Wed Aug 02, 2023 4:19 pm

Javascripts via PDF Tools

Post by dustinbagley »

Is there a way to run javascripts in a tool similar to the way that you can run a script in the xchange editor console? thanks,

Dustin
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Javascripts via PDF Tools

Post by Tracker Supp-Stefan »

Hello dustinbagley,

There is a /runjs command line option:
https://help.pdf-xchange.com/pdfxt ... ns_ed.html

However I am not 100% sure you can e.g. intertwine that with running another tool through the command line. (E.g. I do not think you can insert JS that will run for each file processed and say remove the first 5 pages of it, and then have other operations like say adding watermarks - all into one tool).

Can you please describe your use case that would necessitate such a JS code execution in Tools?

Kind regards,
Stefan
dustinbagley
User
Posts: 22
Joined: Wed Aug 02, 2023 4:19 pm

Re: Javascripts via PDF Tools

Post by dustinbagley »

Stefan,

I do a lot of mechanical drawing checking where I use the annotation tools in xchange editor make mark-ups. I'm just generally looking for ways to speed up or possibly automate certain elements off the process. There are many elements in these drawings that can be marked off logically like drawing numbers or part materials, I'm just trying to find the mechanism to do it. For example, I have a script that looks for one of the common drawing notes and highlights it. This method is more beneficial than an exported comment because the note could be in multiple places on the page, but it doesn't save me much time if I need to run it in the console for each drawing. For that reason, I was wondering if there was a way to add javascripts to the tools. I hope that helps illustrate generally what I'm interested in. Thanks,

Dustin
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Javascripts via PDF Tools

Post by Tracker Supp-Stefan »

Hello dustinbagley,

Just got a confirmation from our devs that you can't really execute JS along PDF Tools, however you can try to automate your processes using the JS console in the Editor. Also the RunJS-cmd in the Editor's cmdline may help you as well.

Kind regards,
Stefan