{"action":"opened","issue":{"url":"https://api.github.com/repos/galkahana/HummusJS/issues/125","repository_url":"https://api.github.com/repos/galkahana/HummusJS","labels_url":"https://api.github.com/repos/galkahana/HummusJS/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/galkahana/HummusJS/issues/125/comments","events_url":"https://api.github.com/repos/galkahana/HummusJS/issues/125/events","html_url":"https://github.com/galkahana/HummusJS/issues/125","id":195303581,"number":125,"title":"How to create buffer","user":{"login":"dottodot","id":811652,"avatar_url":"https://avatars.githubusercontent.com/u/811652?v=3","gravatar_id":"","url":"https://api.github.com/users/dottodot","html_url":"https://github.com/dottodot","followers_url":"https://api.github.com/users/dottodot/followers","following_url":"https://api.github.com/users/dottodot/following{/other_user}","gists_url":"https://api.github.com/users/dottodot/gists{/gist_id}","starred_url":"https://api.github.com/users/dottodot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dottodot/subscriptions","organizations_url":"https://api.github.com/users/dottodot/orgs","repos_url":"https://api.github.com/users/dottodot/repos","events_url":"https://api.github.com/users/dottodot/events{/privacy}","received_events_url":"https://api.github.com/users/dottodot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-13T16:39:09Z","updated_at":"2016-12-13T16:39:09Z","closed_at":null,"body":"Sorry finding it a bit hard to work out from the documentation but I'm trying to modify a pdf, but rather than saving it to disk I need to be able to create a Buffer which can then be used as an email attachment.\r\n\r\nThis is what I have so far which works but write to disk \r\n\r\n```\r\n    var pdfWriter = hummus.createWriterToModify(__dirname + '/voucher.pdf', {\r\n            modifiedFilePath: __dirname + '/TestPageModified.pdf'\r\n        });\r\n        var pageModifier = new hummus.PDFPageModifier(pdfWriter, 0);\r\n        var fontOswald = pdfWriter.getFontForFile('.fonts/Oswald-Bold.ttf');\r\n        pageModifier.startContext()\r\n            .getContext()\r\n            .writeText(\r\n                '£100',\r\n                296, 105, {\r\n                    font: fontOswald,\r\n                    size: 70,\r\n                    colorspace: 'gray',\r\n                    color: 0x00\r\n                }\r\n            ).writeText(\r\n                'CODE: GHGJHJHH',\r\n                296, 80, {\r\n                    font: fontOswald,\r\n                    size: 18,\r\n                    colorspace: 'gray',\r\n                    color: 0x00\r\n                }\r\n            );\r\n        pageModifier.endContext().writePage();\r\n        pdfWriter.end();\r\n``"}}
{"actor":{"display_login":"dottodot"}}