{"action":"created","issue":{"url":"https://api.github.com/repos/nathankerr/pdf/issues/2","labels_url":"https://api.github.com/repos/nathankerr/pdf/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/nathankerr/pdf/issues/2/comments","events_url":"https://api.github.com/repos/nathankerr/pdf/issues/2/events","html_url":"https://github.com/nathankerr/pdf/issues/2","id":58699732,"number":2,"title":"merge","user":{"login":"tgulacsi","id":256074,"avatar_url":"https://avatars.githubusercontent.com/u/256074?v=3","gravatar_id":"","url":"https://api.github.com/users/tgulacsi","html_url":"https://github.com/tgulacsi","followers_url":"https://api.github.com/users/tgulacsi/followers","following_url":"https://api.github.com/users/tgulacsi/following{/other_user}","gists_url":"https://api.github.com/users/tgulacsi/gists{/gist_id}","starred_url":"https://api.github.com/users/tgulacsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgulacsi/subscriptions","organizations_url":"https://api.github.com/users/tgulacsi/orgs","repos_url":"https://api.github.com/users/tgulacsi/repos","events_url":"https://api.github.com/users/tgulacsi/events{/privacy}","received_events_url":"https://api.github.com/users/tgulacsi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-24T06:36:44Z","updated_at":"2015-03-15T18:29:14Z","closed_at":null,"body":"To be able to use the merge example, please either move it to a non-main package, or at least export the appendPDF function name.\r\nNow I have to copy-paste that example code - if that is intended, than ok, but a properly maintained merge function would be better."},"comment":{"url":"https://api.github.com/repos/nathankerr/pdf/issues/comments/81190334","html_url":"https://github.com/nathankerr/pdf/issues/2#issuecomment-81190334","issue_url":"https://api.github.com/repos/nathankerr/pdf/issues/2","id":81190334,"user":{"login":"nathankerr","id":119913,"avatar_url":"https://avatars.githubusercontent.com/u/119913?v=3","gravatar_id":"","url":"https://api.github.com/users/nathankerr","html_url":"https://github.com/nathankerr","followers_url":"https://api.github.com/users/nathankerr/followers","following_url":"https://api.github.com/users/nathankerr/following{/other_user}","gists_url":"https://api.github.com/users/nathankerr/gists{/gist_id}","starred_url":"https://api.github.com/users/nathankerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathankerr/subscriptions","organizations_url":"https://api.github.com/users/nathankerr/orgs","repos_url":"https://api.github.com/users/nathankerr/repos","events_url":"https://api.github.com/users/nathankerr/events{/privacy}","received_events_url":"https://api.github.com/users/nathankerr/received_events","type":"User","site_admin":false},"created_at":"2015-03-15T18:29:14Z","updated_at":"2015-03-15T18:29:14Z","body":"The example code was meant to be copy-pasted (and then potentially modified).\r\n\r\nI am working on a more flexible API that will reduce appendPDF to:\r\n```\r\nfunc appendPDF(newPDFfilename string, filenames []string) {\r\n\tmerged := pdf.New()\r\n\r\n\tfor _, filename := range filenames {\r\n\t\tfile, err := pdf.Load(filename)\r\n\t\tif err != nil {\r\n\t\t\tlog.Fatalln(err)\r\n\t\t}\r\n\r\n\t\tmerged.Catalog.Pages = append(merged.Catalog.Pages, file.Catalog.Pages...)\r\n\r\n\t\terr = file.Close()\r\n\t\tif err != nil {\r\n\t\t\tlog.Fatalln(err)\r\n\t\t}\r\n\t}\r\n\r\n\terr := merged.Save(newPDFfilename)\r\n\tif err != nil {\r\n\t\tlog.Fatalln(err)\r\n\t}\r\n}\r\n```\r\n\r\n"}}