{"action":"created","issue":{"url":"https://api.github.com/repos/bpampuch/pdfmake/issues/338","labels_url":"https://api.github.com/repos/bpampuch/pdfmake/issues/338/labels{/name}","comments_url":"https://api.github.com/repos/bpampuch/pdfmake/issues/338/comments","events_url":"https://api.github.com/repos/bpampuch/pdfmake/issues/338/events","html_url":"https://github.com/bpampuch/pdfmake/issues/338","id":90535227,"number":338,"title":"Is it possible to stream the creation of the pdf?","user":{"login":"jangu","id":3200811,"avatar_url":"https://avatars.githubusercontent.com/u/3200811?v=3","gravatar_id":"","url":"https://api.github.com/users/jangu","html_url":"https://github.com/jangu","followers_url":"https://api.github.com/users/jangu/followers","following_url":"https://api.github.com/users/jangu/following{/other_user}","gists_url":"https://api.github.com/users/jangu/gists{/gist_id}","starred_url":"https://api.github.com/users/jangu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jangu/subscriptions","organizations_url":"https://api.github.com/users/jangu/orgs","repos_url":"https://api.github.com/users/jangu/repos","events_url":"https://api.github.com/users/jangu/events{/privacy}","received_events_url":"https://api.github.com/users/jangu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-24T01:30:32Z","updated_at":"2015-08-21T13:24:16Z","closed_at":"2015-06-29T15:54:35Z","body":"In pdfkit, you're able to create a stream and gradually create the PDF document.\r\n\r\n<pre>\r\nvar PDFDocument = require('pdfkit');\r\nvar doc = new PDFDocument();\r\ndoc.pipe(fs.createWriteStream('/path/to/file.pdf');\r\n\r\n//Grab data and add to the PDF document.\r\ndoc.text(data)\r\n  .moveDown();\r\n\r\n// Grab more data.\r\ndoc.text(moreData);\r\n\r\n// End the document generation later.\r\ndoc.end();\r\n</pre>\r\n\r\nIn pdfmake, the document definition directs the generation of the PDF all at once. It looks like createPDFDocument in printer.js returns a reference to the pdfkit instance."},"comment":{"url":"https://api.github.com/repos/bpampuch/pdfmake/issues/comments/133424553","html_url":"https://github.com/bpampuch/pdfmake/issues/338#issuecomment-133424553","issue_url":"https://api.github.com/repos/bpampuch/pdfmake/issues/338","id":133424553,"user":{"login":"jmorrisIII","id":7073531,"avatar_url":"https://avatars.githubusercontent.com/u/7073531?v=3","gravatar_id":"","url":"https://api.github.com/users/jmorrisIII","html_url":"https://github.com/jmorrisIII","followers_url":"https://api.github.com/users/jmorrisIII/followers","following_url":"https://api.github.com/users/jmorrisIII/following{/other_user}","gists_url":"https://api.github.com/users/jmorrisIII/gists{/gist_id}","starred_url":"https://api.github.com/users/jmorrisIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmorrisIII/subscriptions","organizations_url":"https://api.github.com/users/jmorrisIII/orgs","repos_url":"https://api.github.com/users/jmorrisIII/repos","events_url":"https://api.github.com/users/jmorrisIII/events{/privacy}","received_events_url":"https://api.github.com/users/jmorrisIII/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T13:24:16Z","updated_at":"2015-08-21T13:24:16Z","body":"@jthoenes If I run the above example https://github.com/bpampuch/pdfmake/blob/master/examples/background.js\r\nI get an Unrecognized document structure error if my content is an array ex. content:[...]  but if its an object ex.content:{ text: 'FOO', style: 'BAR' } it works fine. Any Ideas?"}}