split newpage into _openpage and _closepage
change pspages from scalar to array of pages