{"action":"created","issue":{"url":"https://api.github.com/repos/jung-kurt/gofpdf/issues/49","labels_url":"https://api.github.com/repos/jung-kurt/gofpdf/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/jung-kurt/gofpdf/issues/49/comments","events_url":"https://api.github.com/repos/jung-kurt/gofpdf/issues/49/events","html_url":"https://github.com/jung-kurt/gofpdf/pull/49","id":110990455,"number":49,"title":"Compare example PDFs with reference copies","user":{"login":"jung-kurt","id":5148839,"avatar_url":"https://avatars.githubusercontent.com/u/5148839?v=3","gravatar_id":"","url":"https://api.github.com/users/jung-kurt","html_url":"https://github.com/jung-kurt","followers_url":"https://api.github.com/users/jung-kurt/followers","following_url":"https://api.github.com/users/jung-kurt/following{/other_user}","gists_url":"https://api.github.com/users/jung-kurt/gists{/gist_id}","starred_url":"https://api.github.com/users/jung-kurt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jung-kurt/subscriptions","organizations_url":"https://api.github.com/users/jung-kurt/orgs","repos_url":"https://api.github.com/users/jung-kurt/repos","events_url":"https://api.github.com/users/jung-kurt/events{/privacy}","received_events_url":"https://api.github.com/users/jung-kurt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-10-12T14:52:44Z","updated_at":"2015-10-12T18:15:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jung-kurt/gofpdf/pulls/49","html_url":"https://github.com/jung-kurt/gofpdf/pull/49","diff_url":"https://github.com/jung-kurt/gofpdf/pull/49.diff","patch_url":"https://github.com/jung-kurt/gofpdf/pull/49.patch"},"body":"This change is based on @jelmersnoeck's initial PDF comparison code. In order to compare two PDFs, their internal resource catalogs must be similarly sorted and their internal creation timestamps must be the same. Methods were added to enable this. The catalog order needed to be addressed because gofpdf uses hash maps for internal resources and, when writing them to the PDF document, the non-deterministic iteration order resulted in inconsistent internal structure.\r\n\r\nA helper function to compare PDFs was added. This is called by the example.Summary method if a reference file corresponding to an example PDF is found in the pdf/reference directory.\r\n\r\nThis change has not been tested on Mac or Windows yet, nor with versions of Go earlier than 1.5. Verification that it works in these different environments will be appreciated.\r\n\r\nA desirable side effect of having the reference PDFs committed to the repository is that we can include links to them in the documentation.\r\n"},"comment":{"url":"https://api.github.com/repos/jung-kurt/gofpdf/issues/comments/147480173","html_url":"https://github.com/jung-kurt/gofpdf/pull/49#issuecomment-147480173","issue_url":"https://api.github.com/repos/jung-kurt/gofpdf/issues/49","id":147480173,"user":{"login":"jung-kurt","id":5148839,"avatar_url":"https://avatars.githubusercontent.com/u/5148839?v=3","gravatar_id":"","url":"https://api.github.com/users/jung-kurt","html_url":"https://github.com/jung-kurt","followers_url":"https://api.github.com/users/jung-kurt/followers","following_url":"https://api.github.com/users/jung-kurt/following{/other_user}","gists_url":"https://api.github.com/users/jung-kurt/gists{/gist_id}","starred_url":"https://api.github.com/users/jung-kurt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jung-kurt/subscriptions","organizations_url":"https://api.github.com/users/jung-kurt/orgs","repos_url":"https://api.github.com/users/jung-kurt/repos","events_url":"https://api.github.com/users/jung-kurt/events{/privacy}","received_events_url":"https://api.github.com/users/jung-kurt/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T18:15:01Z","updated_at":"2015-10-12T18:15:01Z","body":"@jelmersnoeck I've got the same behaviour here. On 0e7f142 it [fails](https://gist.github.com/jelmersnoeck/2be8c108d582de14c941) for PDFs as well here.\r\n\r\nProblems with those two files are expected since I merged your aligned write fix. (They are the files that had missing space problems.) I commited replacements that should work properly now."}}