{"action":"created","issue":{"url":"https://api.github.com/repos/modesty/pdf2json/issues/34","repository_url":"https://api.github.com/repos/modesty/pdf2json","labels_url":"https://api.github.com/repos/modesty/pdf2json/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/modesty/pdf2json/issues/34/comments","events_url":"https://api.github.com/repos/modesty/pdf2json/issues/34/events","html_url":"https://github.com/modesty/pdf2json/issues/34","id":51193715,"number":34,"title":"Text escaping and granularity","user":{"login":"RichardLitt","id":910753,"avatar_url":"https://avatars.githubusercontent.com/u/910753?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardLitt","html_url":"https://github.com/RichardLitt","followers_url":"https://api.github.com/users/RichardLitt/followers","following_url":"https://api.github.com/users/RichardLitt/following{/other_user}","gists_url":"https://api.github.com/users/RichardLitt/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardLitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardLitt/subscriptions","organizations_url":"https://api.github.com/users/RichardLitt/orgs","repos_url":"https://api.github.com/users/RichardLitt/repos","events_url":"https://api.github.com/users/RichardLitt/events{/privacy}","received_events_url":"https://api.github.com/users/RichardLitt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-12-06T19:50:30Z","updated_at":"2016-04-18T16:42:30Z","closed_at":"2016-04-16T17:20:58Z","body":"I and @rkpatel33 are trying to use pdf2json to get a better understanding of each word in a .pdf file. We need this to enable word-level highlighting and to be able to run NLP libraries on the text. Currently, running a .pdf file through the command line outputs this: \r\n\r\n```json\r\n{\r\n  \"formImage\": {\r\n    \"Transcoder\": \"pdf2json@0.7.1\",\r\n    \"Agency\": \"Microsoft Word - test.docx\",\r\n    \"Id\": {\r\n      \"AgencyId\": \"\",\r\n      \"Name\": \"\",\r\n      \"MC\": false,\r\n      \"Max\": 1,\r\n      \"Parent\": \"\"\r\n    },\r\n    \"Pages\": [\r\n      {\r\n        \"Height\": 49.5,\r\n        \"HLines\": [],\r\n        \"VLines\": [],\r\n        \"Fills\": [\r\n          {\r\n            \"x\": 0,\r\n            \"y\": 0,\r\n            \"w\": 0,\r\n            \"h\": 0,\r\n            \"clr\": 1\r\n          },\r\n          {\r\n            \"x\": 29.083,\r\n            \"y\": 7.936,\r\n            \"w\": 6.105,\r\n            \"h\": 0.015,\r\n            \"clr\": 0\r\n          }\r\n        ],\r\n        \"Texts\": [\r\n          {\r\n            \"x\": 15.262,\r\n            \"y\": 4.471,\r\n            \"w\": 6.573400000000001,\r\n            \"clr\": 0,\r\n            \"A\": \"left\",\r\n            \"R\": [\r\n              {\r\n                \"T\": \"This%09%0D%20%C2%A0is%09%0D%20%C2%A0a%09%0D%20%C2%A0test%09%0D%20%C2%A0of%09%0D%20%C2%A0\",\r\n                \"S\": -1,\r\n                \"TS\": [\r\n                  2,\r\n                  53,\r\n                  0,\r\n                  0\r\n                ]\r\n              }\r\n            ]\r\n          },\r\n          {\r\n            \"x\": 28.827,\r\n            \"y\": 4.471,\r\n            \"w\": 2.6036,\r\n            \"clr\": 0,\r\n            \"A\": \"left\",\r\n            \"R\": [\r\n              {\r\n                \"T\": \"BOLD\",\r\n                \"S\": -1,\r\n                \"TS\": [\r\n                  2,\r\n                  54,\r\n                  1,\r\n                  0\r\n                ]\r\n              }\r\n            ]\r\n          },\r\n          {\r\n            \"x\": 34.648,\r\n            \"y\": 4.471,\r\n            \"w\": 1.9335000000000002,\r\n            \"clr\": 0,\r\n            \"A\": \"left\",\r\n            \"R\": [\r\n              {\r\n                \"T\": \"font.\",\r\n                \"S\": -1,\r\n                \"TS\": [\r\n                  2,\r\n                  53,\r\n                  0,\r\n                  0\r\n                ]\r\n              }\r\n            ]\r\n          }\r\n        ],\r\n        \"Fields\": [],\r\n        \"Boxsets\": []\r\n      }\r\n    ],\r\n    \"Width\": 105.188\r\n  }\r\n}\r\n```\r\n\r\nThe text seems to be all globbed together and escaped: `This%09%0D%20%C2%A0is%09%0D%20%C2%A0a%09%0D%20%C2%A0test%09%0D%20%C2%A0of%09%0D%20%C2%A0`. Is there any way to get `there` in it's own object with positional properties? The content file also doesn't show the text in the original format - before, it was all on one line, but now I get: \r\n\r\n```\r\nThis\t\r\n  is\t\r\n  a\t\r\n  test\t\r\n  of\t\r\n  \r\nBOLD\r\n\t\r\n  \r\nfont.\r\n\t\r\n  \r\n\t\r\n  \r\n\r\n  \r\n\t\r\n  \r\n----------------Page (0) Break----------------\r\n```\r\n\r\nI'm not quite sure if I've misunderstood something. I was hoping for `this is a test of BOLD font`. \r\n\r\nAny ideas? "},"comment":{"url":"https://api.github.com/repos/modesty/pdf2json/issues/comments/211465752","html_url":"https://github.com/modesty/pdf2json/issues/34#issuecomment-211465752","issue_url":"https://api.github.com/repos/modesty/pdf2json/issues/34","id":211465752,"user":{"login":"RichardLitt","id":910753,"avatar_url":"https://avatars.githubusercontent.com/u/910753?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardLitt","html_url":"https://github.com/RichardLitt","followers_url":"https://api.github.com/users/RichardLitt/followers","following_url":"https://api.github.com/users/RichardLitt/following{/other_user}","gists_url":"https://api.github.com/users/RichardLitt/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardLitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardLitt/subscriptions","organizations_url":"https://api.github.com/users/RichardLitt/orgs","repos_url":"https://api.github.com/users/RichardLitt/repos","events_url":"https://api.github.com/users/RichardLitt/events{/privacy}","received_events_url":"https://api.github.com/users/RichardLitt/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T16:42:30Z","updated_at":"2016-04-18T16:42:30Z","body":"Thanks @modesty. I'm no longer working on this project, so this was the right move."}}