Professional Web Applications Themes

Dynamically Activate Button via FDF - Adobe Acrobat Windows

Well that posting didn't show up so well, did it? Looks like you cannot post double arrows here. I've got that all to work, but then the client throws something new at me last minute. He wants to be able to change the TEXT color from black to blue or red or what have you. I've been poring over the doentation. I've tried /RV, /RS, /DS, /anything I could think off in the FDF field definition, and I cannot change the text color for a field dyamically through FDF. Is this even possible?? Thanks, RLS...

  1. #21

    Default Re: Dynamically Activate Button via FDF

    Well that posting didn't show up so well, did it? Looks like you cannot post double arrows here.

    I've got that all to work, but then the client throws something new at me last minute. He wants to be able to change the TEXT color from black to blue or red or what have you.

    I've been poring over the doentation. I've tried /RV, /RS, /DS, /anything I could think off in the FDF field definition, and I cannot change the text color for a field dyamically through FDF.

    Is this even possible??

    Thanks,
    RLS
    RandyLSmith@adobeforums.com Guest

  2. #22

    Default Re: Dynamically Activate Button via FDF

    Hopefully this will show, as a replacement for 18 above, for those looking for this solution. Just change the double-asterisks to two left or right arrow brackets as appropriate:

    %FDF-1.2
    1 0 obj
    **/FDF**/F (http://pdf.xyz.com/pdf/test20040628a.pdf)
    /Target (ShowMe)
    /Fields [
    **/T (emailaddress) /V (com)**
    **/T (fullname) /V (Arthur B. IMadeThisUp)**
    **/T (phone1label) /V (Cell:)**
    **/T (phone1value) /V (651-555-1212)**
    **/T (title) /V (General Proprietor)**
    **/T (Chairman) /SetF 2**
    **/T (Master) /SetF 0**
    **/T (Leadership) /SetF 2**
    **/T (President) /SetF 2**
    ] ****
    endobj
    trailer
    **/Root 1 0 R**
    %%EOF
    RandyLSmith@adobeforums.com Guest

  3. #23

    Default Re: Dynamically Activate Button via FDF



    Is this even possible??




    It used to be, before Acrobat 5. Now you have to use JavaScript in one way or another. Once scheme is demonstrated with: <http://www.peakforms.com/pdfs/eval_ev.pdf>

    You would only need to use this approach if you need to be compatible with pre-5 versions. Starting with Acrobat 5, you can pass the JavaScript in the FDF and have it execute before or after the fields get populated. More information is in the FDF Toolkit doentation and the PDF Reference Manual.

    George
    George_Johnson@adobeforums.com Guest

  4. #24

    Default Re: Dynamically Activate Button via FDF

    Thank you, George. This works:

    /JavaScript <</After (getField('phone1label').textColor = color.green;)>>

    Do you happen to know how to use an RGB color in this scenario? My client is a printer and they have some exact numbers they'll want to use for certain clients.

    RLS
    RandyLSmith@adobeforums.com Guest

  5. #25

    Default Re: Dynamically Activate Button via FDF



    Do you happen to know how to use an RGB color in this scenario?




    Yes, it's doented in the Acrobat JavaScript reference in the "Color Arrays" section. Note that you can specify CMYK as well (via JavaScript only), which may interest your client.

    George
    George_Johnson@adobeforums.com Guest

  6. #26

    Default Re: Dynamically Activate Button via FDF

    This question isn't directly related, but are you two using Professional, and are these JavaScripting capabilities only available in Pro? I've got Standard, and I can't seem to get anything dynamic working.
    Emily_M@adobeforums.com Guest

  7. #27

    Default Re: Dynamically Activate Button via FDF

    Emily,

    To add and modify form fields and use JavaScript with them, you do need Acrobat Pro. I don't know if Standard allows you to create JavaScripts with things such as bookmarks and links.

    George
    George_Johnson@adobeforums.com Guest

  8. #28

    Default Re: Dynamically Activate Button via FDF

    George,

    Well, I'm real close. I can make it work sometimes, with the RGB values, when I update the fdf file manually. But the same looking file doesn't seem to work when done with my program. Real weird.

    And it appears almost to not like it when I do more than one in a row. Now, I tried setting color.blue (for example) like the Javascript docs show, and that worked. So then I thought I'd try creating my own, such as:

    /JavaScript <</After ( color.PhoneLabel = new Array("CMYK", 1, 99, 97, 1); getField('phonelabel_1').textColor = color.PhoneLabel; color.PhoneValue = new Array("CMYK", 90, 84, 0, 0); getField('phonevalue_1').textColor = color.PhoneValue; color.WebAddress = new Array("CMYK", 75, 68, 67, 90); getField('emailaddress').textColor = color.WebAddress;

    and it seems to work... but only for one of them - the phonevalue (the second one). Weird stuff (I got the CMYK values using photoshop).

    And now it's like my hidden/display fields no longer work - I switched to toggling them in javascript because when my client clicks the link I send them to the FDF file, they use a Mac and instead of opening IE it opens Adobe and shows them all the logos regardless. Still does, even with the JavaScript method.

    Things that make you go "hmmmmmmmmmm...."...

    Sorry, Emily, I don't know the answer to your question. Perhaps George or someone else does. I suspect that you do need Professional, though, if you're trying to create the form fields needed to do this.

    RLS
    RandyLSmith@adobeforums.com Guest

  9. #29

    Default Re: Dynamically Activate Button via FDF

    Ooops! Scratch that on the logo show/noshow. I had false and true backwards. Works fine for me now, haven't tested on client.
    RLS
    RandyLSmith@adobeforums.com Guest

  10. #30

    Default Re: Dynamically Activate Button via FDF



    color.PhoneLabel = new Array("CMYK", 1, 99, 97, 1); getField('phonelabel_1').textColor
    = color.PhoneLabel;




    I would be inclined to simplify this to:




    this.getField('phonelabel_1').textColor = ["CMYK", 1, 99, 97, 1];




    Does that make a difference?

    George
    George_Johnson@adobeforums.com Guest

  11. #31

    Default Re: Dynamically Activate Button via FDF

    George -

    Well, it didn't... until I snapped to and realized that the CMYK values are PERCENTAGES.

    Once I put them in as "divided by 100" values, it worked fine. Ex:

    getField('phonelabel_1').textColor = ["CMYK", .01, .99, .97, .01];
    getField('phonevalue_1').textColor = ["CMYK", .90, .84, 0, 0];
    getField('emailaddress').textColor = ["CMYK", .75, .68, .67, .90];

    and all is well with the world.

    Yay! and thanks for the simpler format. That makes coding much much cleaner!

    RLS
    RandyLSmith@adobeforums.com Guest

  12. #32

    Default Re: Dynamically Activate Button via FDF



    until I snapped to and realized that the CMYK values are PERCENTAGES.




    Yea, I meant to use percentages too...really... :^)

    George
    George_Johnson@adobeforums.com Guest

  13. #33

    Default Re: Dynamically Activate Button via FDF

    George,

    Just wanted to thank you again for all your help.

    I may be doing an extremely large (multi-month) project with a Fortune 500 (100?) company starting later this month that will require generating information and putting it into a PDF. Should we need more than the tidbit we had here, I will most definitely contact you about utilizing your consulting services.

    Have a great 4th!
    RandyLSmith@adobeforums.com Guest

  14. #34

    Default Re: Dynamically Activate Button via FDF

    P.S. Interesting PC versus Mac thing I've run into.

    When I send the FDF link to my client and they try to open it with their Mac, it does not run the FDF stuff, and instead shows them the default values, not the real values. I've sent the linke to two different Mac users by email, one who is using Reader v5.0 only, and one using the whole 6.x Acrobat Pro.

    When I click the link on my PC in Outlook, it operates correctly, loading the PDF filled in with the correct values.

    Any clues, anyone? That application/vnd.fdf thing doesn't _seem_ to be the problem, but I guess I don't really have a clue.

    RLS
    RandyLSmith@adobeforums.com Guest

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Dynamically showing button
    By colinwalton in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: February 19th, 09:31 AM
  2. Dynamically adding Dropdown, Text Box, Add Button and Remove Button
    By Rocky in forum ASP.NET Building Controls
    Replies: 1
    Last Post: November 19th, 07:35 AM
  3. Pass URL in button dynamically
    By lak25 in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: January 11th, 02:26 AM
  4. How do you activate a "COMMAND Button" with a macro?
    By RBB in forum Microsoft Access
    Replies: 3
    Last Post: July 7th, 04:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139