Hi,
I've written a small program which demonstrates how new drawing functions could be added. Have a look at the small demo film which shows how it works.
The program is Windows only, you also need to add the Shortcut Ctrl+Shift+Alt+F1 to the Polyline function. And it is just a demonstartion tool, so no checks are done if the PDFXChange-Editor window is on top and active, when you press Shift+Ctrl+F1 to invoke the tool (not the Alternate key)...
Maybe this could be done using Javascript as well? Or is there an API for doing such things more easily?
What about new drawing functions...
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
What about new drawing functions...
- Attachments
-
- PDF Drawing.zip
- (219.32 KiB) Downloaded 51 times
Last edited by Puffolino on Mon Jan 20, 2020 6:18 am, edited 1 time in total.
Re: What about new drawing functions...
Hm, the posting text above seems has been changed automatically ("Spam message...") because of the key word "m o v i e"?
However I try to post a better demo here.
And one hint, you'll get a systray icon which allows you to exit the tool (left click for a menu or just double or right click on the icon).
However I try to post a better demo here.
And one hint, you'll get a systray icon which allows you to exit the tool (left click for a menu or just double or right click on the icon).
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: What about new drawing functions...
Hello Puffolino,
You can use the JS addAnnot method of the document to draw anything that you like https://help.adobe.com/en_US/acrobat/ac ... 3_addAnnot
Here's an Example 4 executed via the Editor: Cheers,
Alex
You can use the JS addAnnot method of the document to draw anything that you like https://help.adobe.com/en_US/acrobat/ac ... 3_addAnnot
Here's an Example 4 executed via the Editor: Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: What about new drawing functions...
C L !
Now showing a dialog to change the parameters would be perfect
Now showing a dialog to change the parameters would be perfect
- Tracker Supp-Stefan
- Site Admin
- Posts: 17910
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: What about new drawing functions...
Hello Puffolino,
Is the above a request for us to provide such a dialogue or is it more a note to self to make your own tool be able to draw such shapes?
If you want to make those drawing shapes directly in the Editor - you can do so by opening the JS console (Ctrl+J) - and then pasting the code samples from the page Sasha linked in there. The parameters to modify should then be pretty obvious.
Or you can make a custom JS button - which when clicked will invoke a dialogue, where you can enter your parameters, and then the script can draw on the page using the parameters supplied in the dialogue box.
Regards,
Stefan
Is the above a request for us to provide such a dialogue or is it more a note to self to make your own tool be able to draw such shapes?
If you want to make those drawing shapes directly in the Editor - you can do so by opening the JS console (Ctrl+J) - and then pasting the code samples from the page Sasha linked in there. The parameters to modify should then be pretty obvious.
Or you can make a custom JS button - which when clicked will invoke a dialogue, where you can enter your parameters, and then the script can draw on the page using the parameters supplied in the dialogue box.
Regards,
Stefan
Re: What about new drawing functions...
Hello Stefan,
not sure, just babbled loud...
> a javascript dialog sounds fine (will google a little bit), but scripts (or buttons with scripts) can't be triggered by shortcuts - not so good.
> a tool like mine could control theoretically do a lot of things, but an API would be useful here because the pdfxchange editor does not use a standard windows construct for handles and messages (I couldn't manage to find a possibility to activate the Polyline using a sendmessage)
Also thought doing a mix of these two worlds, creating a javascript dynamically and start it then. The first part can be done easily, the second would need to popup the javascript console - wouldn't it be nice to allow starting a script in a hidden mode?
Cheers.
not sure, just babbled loud...
> a javascript dialog sounds fine (will google a little bit), but scripts (or buttons with scripts) can't be triggered by shortcuts - not so good.
> a tool like mine could control theoretically do a lot of things, but an API would be useful here because the pdfxchange editor does not use a standard windows construct for handles and messages (I couldn't manage to find a possibility to activate the Polyline using a sendmessage)
Also thought doing a mix of these two worlds, creating a javascript dynamically and start it then. The first part can be done easily, the second would need to popup the javascript console - wouldn't it be nice to allow starting a script in a hidden mode?
Cheers.
- Tracker Supp-Stefan
- Site Admin
- Posts: 17910
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: What about new drawing functions...
Hello Puffolino,
You can write your JS and make a custom button that will appear in a new "Add-on Tools" ribbon tab: As explained e.g. here:
viewtopic.php?f=62&t=28407&p=111667
And then that custom Script could show a dialogue window asking you for the input values: (How to create advanced dynamic stamps is explained here: https://www.pdf-xchange.com/knowledgebase/543)
So everything will be handled inside the Editor - via JS alone, and there will still be user interaction to supply the dynamic input details as needed.
Cheers,
Stefan
You can write your JS and make a custom button that will appear in a new "Add-on Tools" ribbon tab: As explained e.g. here:
viewtopic.php?f=62&t=28407&p=111667
And then that custom Script could show a dialogue window asking you for the input values: (How to create advanced dynamic stamps is explained here: https://www.pdf-xchange.com/knowledgebase/543)
So everything will be handled inside the Editor - via JS alone, and there will still be user interaction to supply the dynamic input details as needed.
Cheers,
Stefan