Updated code to support latest pdfkit
Known Issues: streaming is currently broken, console.warning is currently logged because we are still using the old pdfkit write interface.