JS script to generate PS of page of lines