Printing from index.html, added encoding option