{"action":"created","issue":{"url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/240","repository_url":"https://api.github.com/repos/open-xml-templating/docxtemplater","labels_url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/240/comments","events_url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/240/events","html_url":"https://github.com/open-xml-templating/docxtemplater/issues/240","id":169317965,"number":240,"title":"Is their any way to copy a macro(like Table of content) from docx template to dynamically generated docx file? ","user":{"login":"devendrak-sdn","id":13144888,"avatar_url":"https://avatars.githubusercontent.com/u/13144888?v=3","gravatar_id":"","url":"https://api.github.com/users/devendrak-sdn","html_url":"https://github.com/devendrak-sdn","followers_url":"https://api.github.com/users/devendrak-sdn/followers","following_url":"https://api.github.com/users/devendrak-sdn/following{/other_user}","gists_url":"https://api.github.com/users/devendrak-sdn/gists{/gist_id}","starred_url":"https://api.github.com/users/devendrak-sdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devendrak-sdn/subscriptions","organizations_url":"https://api.github.com/users/devendrak-sdn/orgs","repos_url":"https://api.github.com/users/devendrak-sdn/repos","events_url":"https://api.github.com/users/devendrak-sdn/events{/privacy}","received_events_url":"https://api.github.com/users/devendrak-sdn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-04T08:23:19Z","updated_at":"2016-08-08T08:10:57Z","closed_at":null,"body":"Please read the following before opening an issue :\r\n===================================================\r\n\r\n-\tRead the docs at http://docxtemplater.readthedocs.io/en/latest/\r\n-\tCheck whether your issue appears with the latest version of docxtemplater (lots of bugs have already been solved)\r\n\r\nIf you have an error message, please include the full error message + stacktrace, and you can also log the properties object of that error, with for example the following code :\r\n\r\n```js\r\ntry {\r\n\tdoc.render();\r\n}\r\ncatch (error) {\r\n\tconsole.log(JSON.stringify({error: error}));\r\n}\r\n```\r\n\r\nPlease remove the text before this line when submitting your issue.\r\n\r\nEnvironment\r\n===========\r\n\r\n-\tVersion of docxtemplater :\r\n-\tUsed docxtemplater-modules :\r\n-\tRunner : Browser/Node.JS/...\r\n\r\nHow to reproduce my problem :\r\n=============================\r\n\r\nMy template is the following : (Upload the docx file here inside github, which you have to name template.zip (github doesn't accept the docx extension))\r\n\r\nWith the following js file :\r\n\r\n```js\r\nvar fs = require('fs');\r\nvar Docxtemplater = require('docxtemplater');\r\n\r\n//Load the docx file as a binary\r\nvar content = fs\r\n    .readFileSync(__dirname + \"/template.zip\", \"binary\");\r\n\r\nvar doc = new Docxtemplater(content);\r\n\r\n//set the templateVariables\r\ndoc.setData({\r\n\t( INSERT YOUR DATA HERE )\r\n});\r\n\r\n//apply them (replace all occurences of {first_name} by Hipp, ...)\r\ndoc.render();\r\n\r\nvar buf = doc.getZip()\r\n             .generate({type:\"nodebuffer\"});\r\n\r\nfs.writeFileSync(__dirname+\"/output.docx\",buf);\r\n```\r\n\r\nI would expect it to return the following template (upload your expected document if necessary), but it fails instead (include error message) / returns the following instead (upload your result here);\r\n"},"comment":{"url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/comments/238169183","html_url":"https://github.com/open-xml-templating/docxtemplater/issues/240#issuecomment-238169183","issue_url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/240","id":238169183,"user":{"login":"devendrak-sdn","id":13144888,"avatar_url":"https://avatars.githubusercontent.com/u/13144888?v=3","gravatar_id":"","url":"https://api.github.com/users/devendrak-sdn","html_url":"https://github.com/devendrak-sdn","followers_url":"https://api.github.com/users/devendrak-sdn/followers","following_url":"https://api.github.com/users/devendrak-sdn/following{/other_user}","gists_url":"https://api.github.com/users/devendrak-sdn/gists{/gist_id}","starred_url":"https://api.github.com/users/devendrak-sdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devendrak-sdn/subscriptions","organizations_url":"https://api.github.com/users/devendrak-sdn/orgs","repos_url":"https://api.github.com/users/devendrak-sdn/repos","events_url":"https://api.github.com/users/devendrak-sdn/events{/privacy}","received_events_url":"https://api.github.com/users/devendrak-sdn/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T08:10:57Z","updated_at":"2016-08-08T08:10:57Z","body":"I had tried with the basic way of creating the table of content using docx option 'Index and table'.\r\nWhatever the table of content we had provided in Parent template. It should update the page number of newly generated docx file. But it is not happening.\r\nWhen we are updating the Index/table option, then it is giving proper page number and Heading naming convention.\r\n\r\nIs their any way we can run 'updating the Index/table' option by code base?"}}
{"actor":{"display_login":"devendrak-sdn"}}