Code to convert pages files to HTML