Skip to main content
Participant
October 18, 2016
Answered

Incorrectly duplicating pages - Seems problem with Acrobat itself

  • October 18, 2016
  • 1 reply
  • 679 views

Hey all!

I have a PDF that has a button that duplicates one of the pages. No problems there, it works great. However, if you click the button a few times, then delete any of the duplicated pages, then create a new copy, then problems arise.

Say I have "Page 1" then click the button twice, so now I have "Page 1", "Copy1 of Page 1", and "Copy2 of Page 1"

Now I delete "Copy1 of Page 1"

Now I click the copy page button again.

Instead of creating the expected "Copy3 of Page 1" is creates "Copy2 of Page 1" again.

So, now there are two "Copy2 of Page 1", so when you type something in one of the pages, it changes the text on both "Copy2 of Page 1". That makes sense, but it shouldn't be creating a second "Copy2 of Page 1"

Any ideas why this is happening or how to fix it?

-Andrew

This topic has been closed for replies.
Correct answer George_Johnson

George_Johnson

It will make it slightly inconvenient on the user's end, as they'd have to clear the page they want deleted and just replace the previous data with the new data. However, I don't think that is a big issue.

Is there a way that I can just make it so pages can't be deleted at all?


You could add a button to reset the fields on the page. The users won't be able to delete a page if you don't provide a means to delete it. You're able to delete pages in Acrobat, but Reader users won't be able to do the same thing.

1 reply

Bernd Alheit
Community Expert
Community Expert
October 18, 2016

May be a problem with the JavaScript code at the button.

Participant
October 18, 2016

Here is the code. I can't see why it would cause such a problem

var expTplt = getTemplate("Copy_Page");

expTplt.spawn(numPages,true,false);

Participant
October 18, 2016

Bernd Alheit

Ok, I understand it is because if I make 3 pages (so now there are 4) and delete 2 (now 2) the numPages will start at 3. How can I change the field names without basing it on the page numbers, so that they don't duplicate?