Skip to main content
Participating Frequently
February 5, 2020
Question

Place a limit on size of photo to imbed to a pdf fillable form

  • February 5, 2020
  • 3 replies
  • 843 views

I have created a fillable form for contestants to submit their application for an award; I want the applicants to attach photos in image boxes provided, but I would like to limit the size of the photos to 200K each. I have not found any guidance on how to do this. Does anyone have any suggestions on how to achieve this? Thanks

This topic has been closed for replies.

3 replies

Thom Parker
Community Expert
Community Expert
February 5, 2020

Unfortunately you can't get a direct byte size from an image imported into a button (i.e. an image field). First, Acrobat can change (convert formats) when the image is imported, so it's not exactly the same as the one the user provided. 

 

However, there are a couple of indirect methods for finding out about the size of the image in Acrobat.

 

1) The width and height of the image can be acquired directly. This is not an exact byte size measure, but it can get you a good estimate.

 

2) There is a "doc.filesize" property that gives the size of the file on disk. It does not provide the change in size when image import happens. The file has to be saved first. Then the filesize updates. So the script for calculating the size would have to ask the user to save the PDF first.  

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
September 11, 2024

I have a PDF form, which I created using Adobe Acrobat Pro dc. In the form, there are many image fields. when I add all the images, the form gets too big, like 120 MB. Can you help me with this issue?

I need the form 10-15 MB.

(To not overload the file, limit the photo to medium size 1024x768) in pdf form

Legend
February 5, 2020

You really need an HTML form with server back end for this. For example, I'd expect a lot of contestants to want to use a phone, and PDF forms are unlikely to cut it. Back end needs to be developed by an experienced specialist.

Bernd Alheit
Community Expert
Community Expert
February 5, 2020

Not possible.