Skip to main content
Known Participant
September 8, 2009
Question

How to duplicate pages effectively

  • September 8, 2009
  • 1 reply
  • 1782 views

Hi all,

we want to create 1000 page document from a single page template, hence we create pages using duplication.

"for (var i=1; i<noOfPages; i++){
        myDocument.pages.item(0).duplicate(LocationOptions.AT_END,myFirstPage);   
    }"

During debugging we found the page creation time increases linearliy with increase in page

ie creation of page is as following

1st - 1sec

2nd - 1sec

3rd - 1sec

.

.

.

10th - 3sec

.

.

.

100th-40sec.

Is there an alternate approach to acheive the above work ?

This topic has been closed for replies.

1 reply

Harbs.
Legend
September 8, 2009

First of all, it should be:

myDocument.pages.item(0).duplicate(LocationOptions.AFTER,myFirstPage);

About your problem:

You need to clear the undo stack. Doing a "save as" every once in a

while does the trick.

Harbs

Known Participant
September 8, 2009

Thanks Harbs,

But hw to disable Undo ?

Harbs.
Legend
September 8, 2009

You can't disable it. Doing a "save-as" clears it.

Harbs