jAVASCRIPT and properties

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

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

Post Reply
countryside_01
User
Posts: 2
Joined: Sun Feb 02, 2014 10:09 pm

jAVASCRIPT and properties

Post by countryside_01 » Sun Sep 08, 2019 5:47 pm

Hello all,

I an currently trying my first javascript issues to improve some of my forms.
I found several ideas here, thanks !

We are currently trying to get a forms which will be sent to customers to review some addresses, mails phones and other stuff.
The idea, is :
  1. we send an pdf to the customer with the information we get already filled from our CRM (ok)
  2. the guy is validating the parameters
  3. should he want to change one, we ask him to check a box which will unprotect the fields. Is there a way to create a function which unprotects a field ?
  4. he will then update what is needed.
  5. and return it to our attention.
But when he changes a field, we would like to change the background color of the field, to make our assistants' life easier !
Any idea ?
By the way, is there a link to the events and forms parameters I can use (as you guess I am NOT a javascript expert !!)

Thanks by advance for your help,

All the best,
Franck
Franck

User avatar
Paul - Tracker Supp
Site Admin
Posts: 4944
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: jAVASCRIPT and properties

Post by Paul - Tracker Supp » Mon Sep 09, 2019 3:27 pm

Hi Franck,

If I understand your needs correctly, you want to be able to toggle the "lock" state of form fields and believe it should be possible.
Take a look at the JavaScript API from Adobe, we adhere to it, and this should give you all the resources you need:
https://www.adobe.com/content/dam/acom/ ... erence.pdf

Do let us know if you have specifics questions around implementing that after going through that document.

regards
_________________
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

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

countryside_01
User
Posts: 2
Joined: Sun Feb 02, 2014 10:09 pm

Re: jAVASCRIPT and properties

Post by countryside_01 » Tue Sep 10, 2019 4:56 pm

Hi Paul,

thank you for your help !
So, it is almost done, but .....
1. When opening document , i reset all fillColor to transparent, OK :)
2. When the customer says ' ii want to moddify the informatons', I unprotect several fields, ok. :)
3. When a field is modified , I set the javascript option , which set the fillColor to red. OK :)

But.... IS there a way to create such script as a kind of 'function' (because it will be basically the same for all the fields) :?:
AND... Is there a way to set all my fields to that globally ? :|

AND, last but not least... The PDF Form is almost completed, We will draw some lines , boxes... to get it nicer , and suddenly it seems that PDFXchange does not appreciate drawing lines adn other stuff too much !

Any idea ?

Best regards,
 
Franck

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 2517
Joined: Wed Jan 03, 2018 6:52 pm

Re: jAVASCRIPT and properties

Post by TrackerSupp-Daniel » Tue Sep 10, 2019 7:32 pm

Hello Countryside_01,

You can turn any JS into a UI button to be initiated with a click by following this KB: https://www.tracker-software.com/knowle ... the-Editor

Regarding affecting all fields globally, you should be able to use a "catch all" string in the JS, so that it will affect all fields at the same time.

Regarding your final issue with drawing lines. Can you please provide more details on what you mean by "it does not appreciate drawing lines and other stuff too much" ? Does the application freeze or crash, do you find it running more slowly than usual, also, how many content items, like these lines, already exist on the page? If possible, please send a sample document so we can attempt to reproduce this issue.

Kind regards,
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Post Reply