Skip to main content
RNGeer69
Participant
January 29, 2025
Question

Dynamic image in form field rotation

  • January 29, 2025
  • 2 replies
  • 147 views

Hello, I have a pdf with form fields that popupates dynaic text and an image to create and ID badge. Due to print requirements, the pdf needs to be rotated for the final printing. The text fileds rotate fine but the image does not. Has anyone had any luck correcting this? I have read that Acrobat isn't reading the exif data correctly.

 

Any info would be great. 

 

2 replies

try67
Community Expert
Community Expert
January 30, 2025

You can use a script to set the rotation property of all the images automatically to a certain value:

 

for (var i=0; i<this.numFields; i++) {
	var fname = this.getNthFieldName(i);
	var f = this.getField(fname);
	if (f==null) continue;
	if (f.type=="button" && f.buttonPosition!=position.textOnly) {
		f.rotation = 90;
	}
}
Amal.
Legend
January 29, 2025

Hi there

 

Hope you are doing well, and thanks for reaching out.

 

Acrobat handles text field rotation correctly but not the image, likely due to how it interprets EXIF orientation data. Acrobat does not automatically adjust images based on EXIF metadata, which can cause them to appear unrotated when form fields are rotated.

 

As a workaround, please try rotating the image manually (using a Photo editing tool) before uploading it, and then try inserting it into the image field and see if that works.

 

Let us know how it goes.