We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com


I’m using FillImageField to place an image on a button field. It works - but the image is stretched to fit the space. How does one constrain proportions on an image? Or do I need to use an alternate method for adding an image (I looked everywhere and seem to see conflicting documentation on this.)


Hello Bill,

Thanks for using our products.

As per your requirement, I would suggest you to please try using
AddImage method of
ButtonField class present in Aspose.Pdf.InteractiveFeatures.Forms Namespace. Please note that AddImage method accepts System.Drawing.Image object as an argument so you can first resize the source image file and then pass the Image object to this method. Please try using it and in case you encounter any issue or you have any further query, please feel free to contact. We apologize for your inconvenience.

PS, Please note that Aspose.Pdf.InteractiveFeature.Forms namespace is present in new Merged API.

Thank you - I have done (effectively) this by manipulating the image prior to using the FillImageField. Thank you!