Copy link to clipboard
Copied
I have an image field which allow users to import an image with event.target.buttonImportIcon().
How can I check for image type (for ex :- jpeg) and file size after the image is imported ?
Copy link to clipboard
Copied
Once an image is imported, it is a PDF image - it is no longer a JPEG, PNG or any kind of external file. Similarly you don't know how much size it adds to the PDF. You can export it to get the size (if not automatically) but that won't be the size of the original image file.
Copy link to clipboard
Copied
Once an image is imported, it is a PDF image - it is no longer a JPEG, PNG or any kind of external file. Similarly you don't know how much size it adds to the PDF. You can export it to get the size (if not automatically) but that won't be the size of the original image file.
Copy link to clipboard
Copied
Thank you for the explanation, is there a way to achieve this ? maybe a workaround ?
Copy link to clipboard
Copied
You can't. A script has no access to this information. I don't think it's even available in the PDF file at all.
Copy link to clipboard
Copied
What you can do, though, is check the file size of the PDF file before and after the image is added to it... You might need to save it first, though.
Copy link to clipboard
Copied
oh yes i see i'll try that too thanks
Copy link to clipboard
Copied
"maybe a workaround ?"
May be by importing an attachment, see this topic:
Copy link to clipboard
Copied
Thanks this helps a lot. Now i have to transform this attachement into a visible image 😄
Find more inspiration, events, and resources on the new Adobe Community
Explore Now