Moved paper code from DrawPDF.js into Stack.js