Insert multiple images in pdf form

Explorer ,
Jun 13, 2020

Copy link to clipboard

Copied

Hi, my interative pdf contains multiple image fields where the client has to click on each each field to insert an image.  Is there a way that my client can insert as many as 100 images in one click? Or perhaps if they can insert a photo album directly from the PDF?

would highly appreciate your help with this. 

PS my clients will be using Acrobat reader. 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

No, that is not possible, unless you know the names of the files in advance and can install a script on the local computer of each client. What is possible, though, is to use a loop to prompt them to select the images one by one and import them directly into the field until they click Cancel. That would save them the step of having to click each image field, but they would still need to manually select all the images.

TOPICS
Acrobat SDK and JavaScript, Create PDFs, Edit and convert PDFs, PDF forms

Views

404

Likes

Translate

Translate

Report

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

Insert multiple images in pdf form

Explorer ,
Jun 13, 2020

Copy link to clipboard

Copied

Hi, my interative pdf contains multiple image fields where the client has to click on each each field to insert an image.  Is there a way that my client can insert as many as 100 images in one click? Or perhaps if they can insert a photo album directly from the PDF?

would highly appreciate your help with this. 

PS my clients will be using Acrobat reader. 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

No, that is not possible, unless you know the names of the files in advance and can install a script on the local computer of each client. What is possible, though, is to use a loop to prompt them to select the images one by one and import them directly into the field until they click Cancel. That would save them the step of having to click each image field, but they would still need to manually select all the images.

TOPICS
Acrobat SDK and JavaScript, Create PDFs, Edit and convert PDFs, PDF forms

Views

405

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 13, 2020 0
Explorer ,
Jun 14, 2020

Copy link to clipboard

Copied

Hi, my interative pdf contains multiple image fields where the client has to click on each each field to insert an image.  Is there a way that my client can insert as many as 100 images in one click? Or perhaps if they can insert a photo album directly from the PDF?

would highly appreciate your help with this. 

PS my clients will be using Acrobat reader. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 14, 2020 0
Most Valuable Participant ,
Jun 14, 2020

Copy link to clipboard

Copied

No, that is not possible, unless you know the names of the files in advance and can install a script on the local computer of each client. What is possible, though, is to use a loop to prompt them to select the images one by one and import them directly into the field until they click Cancel. That would save them the step of having to click each image field, but they would still need to manually select all the images.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 14, 2020 1
Explorer ,
Jun 14, 2020

Copy link to clipboard

Copied

Thanks a lot for your suggestion...can you please guide on hiw this loop may be created? If you can share a script it would be great! 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 14, 2020 0
Most Valuable Participant ,
Jun 14, 2020

Copy link to clipboard

Copied

Let's say the fields are called Image1 to Image100. You can then use this code to import an image into field 1, then 2, etc., until reaching 100 or until the users clicks Cancel in the Select Image dialog:

 

for (var i=1; i<=100; i++) {
	if (this.getField("Image"+i).buttonImportIcon()!=0) break;
}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 14, 2020 0
Explorer ,
Jun 18, 2020

Copy link to clipboard

Copied

Thanks a lot Try67...it works like charm....really appreciate.

One more question.

Is there a way to compress these pictures to a predefined DPI so that pdf size does not get so big.  After attaching the pictures in the form, i want my client to attach the same in an email and we are restricted with size of 25 MB.  Thanks for all your help...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 18, 2020 1
Most Valuable Participant ,
Jun 18, 2020

Copy link to clipboard

Copied

No, you can't compress the files or force them to be a specific size. You can, however, add a script to the file's Did Save even that warns the user if the file is too large...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 18, 2020 1
NKB0609 LATEST
Explorer ,
Jun 20, 2020

Copy link to clipboard

Copied

Thanks a lot for your response.  Guess will settle with your above solution.  Many thanks for your assistance on this. 🙂🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 20, 2020 0