I am confused... are you intentionally printing pages 1 to 5? Here is what I will code just in case I need to print only pages 1 to 5.
$host.print(1, "0", "4", 0, 1, 0, 0, 0)
"0" stands for starting page number. In this case page 1.
"4" stands for ending page number. in this case page 5.
Note: This numbering system starts from 0 indexing.
So for to print page 6 to 15 I would use...
$host.print(1, "5", "14", 0, 1, 0, 0, 0)
"5" stands for starting page number. I this case page 6.
"14" stands for ending page number. In this case page 15.
for to print pages 1 to 15 I would use...
$host.print(1, "0", "14", 0, 1, 0, 0, 0)
And to print all the pages in the document me knowing number of pages I would use following JavaScript code...
xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);
Check your code with these scenarios.
Good luck,
SekharN,
www.lawson.com