Skip to main content
ericc747
Participant
November 18, 2017
Question

How Can I Use Javascript to Fill Shape Background Color with Hex Code?

  • November 18, 2017
  • 1 reply
  • 580 views

On my PDF I have one form field where someone can input a hex code and to the right of that I have another box.

If possible, I would love to use Javascript to make it so when someone inputs a hex code it changes the fill color of the box to the right with that color.

Here is a screenshot of my PDF:

I'm not sure if this is possible, but fingers crossed it is

Important to note I have a very basic understanding of Javascript.


Thank you for your help,

Eric

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
November 19, 2017

Here is an article on using colors in Acrobat JavaScript

https://acrobatusers.com/tutorials/using-colors-acrobat-javascript

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often