Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Extract pages to separate pdf's (something wrong with loop?)

$
0
0

Please check following code.

Acrobat makes duplicates of the original file with all pages in each new generated files instead of the right extracted pages (example: filename_page_2.pdf must be page 2 of the original pdf).

Another question is that now when the script was running is that at the end of the batch Acrobat asks to save the original file

What am I doing wrong?

 

 

/* Extract Pages to Folder */


    var re = /.*\/|\.pdf$/ig;


    var filename = this.path.replace(re,"");
    var lastPage=this.numPages-1;

    {
        for ( var i = 0;  i < this.numPages; i++ )
        this.extractPages
         ({
            nStart: 0,
            nEnd: lastPage,
            cPath : filename + "_page_" + (i+1) + ".pdf"
        });
    };


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>