var myIconStream = "ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffff00fdffffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2ffff00d2fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00fff6ff00ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000";
var oIcon = { count: 0, width: 20, height: 20,
read: function(nBytes) {return myIconStream.slice(this.count, this.count += nBytes)},
GetIcon: function() {this.count = 0; return this;} };
var myButtonPress = app.trustedFunction(function(){
app.beginPriv();
var newDoc = app.newDoc();
var np=app.response({
cQuestion: "Input pages count:",
cDefault: 4,
});
var i = 0;
var k = 0;
var ndoc = 0;
var curname=this.path.split('.')[0];
while (i < this.numPages)
{
newDoc.insertPages( {
nPage: newDoc.numPages-1,
cPath: this.path,
nStart: i
});
k++;
if (k==np)
{
newDoc.deletePages(0);
newDoc.saveAs(curname+"_"+ndoc+".pdf");
newDoc.closeDoc();
newDoc = app.newDoc();
k=0;
ndoc++;
}
i++;
}
if (k!=0)
{
newDoc.deletePages(0);
newDoc.saveAs(curname+"_"+ndoc+".pdf");
newDoc.closeDoc();
}
app.endPriv();
return;
});
if (app.viewerVersion < 10) {
app.addMenuItem({ cName: "Split4", cUser: "Split4", cParent: "Tools", cExec: "myButtonPress()",
cEnable: "event.rc = (event.target != null);"});
} else { app.addToolButton({ cName: "Split4", cLabel: "Split4", oIcon: oIcon, cExec: "myButtonPress()",
cEnable: "event.rc = (event.target != null);"});
}