Script - Dialog
Set visibility flag for each n'th page:
local step=2;
local start=1;
local data=CfgGetValue("MarkPages/start");
if(data.len())
start=data.tointeger();
data=CfgGetValue("MarkPages/step");
if(data.len())
step=data.tointeger();
local dlg=Dialog ();
dlg.title="Mark Pages";
local H0=Font("Segoe UI Light");
H0.Height=32;
dlg.Insert("id_h0","text",{title="Page Mark",font=H0});
dlg.Insert("id_start","edit",{title="Start From:",value=start,min=1,max=100000,type="integer",suffix="Page"});
dlg.Insert("id_step","edit",{title="Mark Eeach:",value=step,min=1,max=100000,type="integer",suffix="Page"});
dlg.Button("OK",1);
dlg.Button("Cancel",0);
if(dlg.Execute())
{
start=dlg.id_start;
step=dlg.id_step;
CfgSetValue("MarkPages/start",start);
CfgSetValue("MarkPages/step",step);
step--;start--;
local doc=window.GetDocument();
local count=doc.numpages;
local i;
local j=0;
for(i=0;i<count;i++)
{
local page=doc.GetPage(i);
if(i<start)
{
page.visibility=0;
}else
if(j)
{
page.visibility=0;j--;
}else {page.visibility=1;j=step;}
}
}
