Change Object color on click  SOLVED

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

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

Post Reply
Anderl
User
Posts: 4
Joined: Tue Jun 13, 2017 7:32 am

Change Object color on click

Post by Anderl »

Hello,
My first post here, salutations.
Currently using PDF-Xchange editor in demo mode. Build 319.0
I have a pdf file edited/exported from CorelDraw. I can select objects (e.g. rectangle) using the "Edit content" tool, and change its properties, but I'm wondering if there is a way to change the fill color by clicking on it. Colour should change alternatively between green and red on every click. Can I get the Element Id and change its properties using javascript?
Thanks in advance.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Change Object color on click

Post by Tracker Supp-Stefan »

Hello Anderl,

Welcome to our forums, and thanks for your enquiry.
There's no such tool unfortunately, and as far as JS inside PDF files is concerned - it has access to the annotation objects in the document, but not to the base content elements - so it can't even theoretically be used for this automation you want.

If there would be many objects that need to be modified - why not select a few at a time (with the Ctrl key + mouse clicks) - and only then change the colour?

Regards,
Stefan
Anderl
User
Posts: 4
Joined: Tue Jun 13, 2017 7:32 am

Re: Change Object color on click

Post by Anderl »

Thanks Stefan for your reply.

Well... what I really want to do, is to link object properties (e.g. rectangle fill color) with the value of some text fields (e.g. red if text field value < 0; green if text field value > 0).
There is really no option of doing something like that?
Regards.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Change Object color on click

Post by Will - Tracker Supp »

Hi Anderl,

Can you send a sample document and advise on the content within it you're looking to change? If we can see an example, we should then be able to advise on some way that this could be done.

Cheers,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Anderl
User
Posts: 4
Joined: Tue Jun 13, 2017 7:32 am

Re: Change Object color on click

Post by Anderl »

Of course Stefan, thank you for your interest. Please, see attached doc.
I want to place some Text Fields (using the Edit Form tool) in the "VALUE" column and link that value with the corresponding objetc, so that its Fill color should become green if value < 0, and red if > 0.
Attachments
FillColorChange.7z
(5.1 KiB) Downloaded 49 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Change Object color on click  SOLVED

Post by Tracker Supp-Stefan »

Hello Anderl,

Thanks for the sample file.
Those sections of your diagram are just vector paths - they do not have any unique names, and there are no provisions in the PDF specification to control these through JS.
You can create a logic for a text form field that can exxecute some JS and perform some operations - but those have to be e.g. on other form fields (as those have unique names) - but you can't have a form field with the shape and size you need.
I do not think we have the tools needed for you to create this interactivity.

Regards,
Stefan
Anderl
User
Posts: 4
Joined: Tue Jun 13, 2017 7:32 am

Re: Change Object color on click [SOLVED]

Post by Anderl »

Hello Stefan,
What a pity... but it's exactly what I imagined, since I was unable to locate an unique ID for those vector paths.
Anyway, thank you so much for your time.
Best regards,
Anderl
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Change Object color on click

Post by Tracker Supp-Stefan »

Hello Anderl,

Sorry I could not find a solution for you!

Cheers,
Stefan
Post Reply