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

Photo Report Manipulation Document

Participant ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

I'm working on adding features to the attached document. The intent is for techs to be able to open the file, fill it out, and generate a report. One feature that would be very useful would be to delete a photo in the middle of the document (easy part) and have the photos below it each move up. This will mean moving the top photo/caption of one page up to the bottom of the previous page, moving the bottom one to the top, rinse, repeat (hard part). How can I best achieve this?

TOPICS
Acrobat SDK and JavaScript

Views

42

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
community guidelines
Community Expert ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

You can use the buttonSetIcon and buttonGetIcon methods to copy the image from one field to another.

You can't really reset a selected button's field directly, though. A workaround is to keep a (hidden) empty button field and copy its icon to the fields that you want to reset.

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
community guidelines
Participant ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

So if I used buttonSetIcon and buttonGetIcon--I figure I will want to store each icon/caption occuring past the one to be deleted in an array, then iterate buttonSetIcon through the array, changing all affected buttons. Does this sound like the right approach?

 

Another issue to consider is deleting pages in the PDF. I have a counter that numbers my unique fields. Normally they'll be numbered sequentially, similar to what spawn does with bRename = true. If a user deletes a page from the PDF, the sequence is off. My numbering will continue to count up, so I avoided that issue, but how will I check for this issue when iterating through all my buttons?

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
community guidelines
Community Expert ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

LATEST

Yes, that sounds about right.

 

You will get into all kinds of issues if you delete pages and then spawn new ones. The numbering will be off, and you might get duplicate field names. It's a very tricky thing to set up correctly.

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
community guidelines