Text Form fields to show on top of Image Form Field
Copy link to clipboard
Copied
I need to place a text form field on top of an image form field (that the user uploads) - i.e. i want the text that a user types in to be showing on top of the image after the user has uploaded their photo. The user will be using Adobe Acrobat Reader DC the free version (not Pro)
Is this possible? I can't seem to get the image form field (once a photo has been uploaded) to move behind a text form field.
Thanks
Simone
Copy link to clipboard
Copied
You could try using the button label. Image form fields are actually buttons. And it can be setup to show a label over the button image. Look at the Options tab on the field properties. Set the Layout to one of the Label plus Icon options.
You'll need a way to get user entered text onto the label. I'd suggest adding this code to the existing MouseUp script on the "image" (button) field.
var cLabel = app.response("Enter Label Text");
event.target.buttonSetCaption(cLabel);
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thanks for your speedy help! I just tried that and it works a treat but I'm looking for something that I can customize a bit more. Is it possible to choose different alignments of that label (apart from the default center, top, bottom?) and change the fonts/colors like in a regular text field? or multiple labels?
Alternatively, is it possible to flatten that photo once it's been uploaded (in the free Reader) so if I put text fields on top they will show up?
Copy link to clipboard
Copied
The appearance tab on the properties dialog controls the font properties, same as on the text field.
The label positions are what they are. Can't flatten in the free Reader. But the button field can be made ReadOnly.
However, text fields can be made to sit on top of the button field, simply by the order in which they are created. The text field will not show when the button has the focus, but as soon as the focus changes it should become visible over the button.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
NEVER overlap visible fields. The display order is not well defined and may change in different apps/viewers/printers.
Copy link to clipboard
Copied
I hear you Andy, It's definately not a reliable strategy. Definately a bad idea.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
It's not a good idea to have overlapping fields since you can't explicitly control their z-order (ie, which one will appear on top of another). It's basically works so that the last field you edit (not fill it, but actually manipulate in Form Edit mode) is the one on top, which is not very convenient. I would strongly recommend looking for an alternate way of doing it.

