Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Check image type and size in an interactive pdf Adobe acrobat pro dc

Community Beginner ,
Feb 24, 2022 Feb 24, 2022

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 ?

TOPICS
How to , JavaScript , PDF forms
3.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
LEGEND ,
Feb 24, 2022 Feb 24, 2022

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. 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 24, 2022 Feb 24, 2022

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 24, 2022 Feb 24, 2022

Thank you for the explanation, is there a way to achieve this ? maybe a workaround ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2022 Feb 24, 2022

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2022 Mar 04, 2022

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 04, 2022 Mar 04, 2022
LATEST

oh yes i see i'll try that too thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2022 Feb 24, 2022

"maybe a workaround ?"

May be by importing an attachment, see this topic:

https://community.adobe.com/t5/acrobat-discussions/add-an-quot-attach-file-quot-button-to-a-pdf-form...


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 04, 2022 Mar 04, 2022

Thanks this helps a lot. Now i have to transform this attachement into a visible image 😄

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines