{"action":"created","issue":{"url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/373","repository_url":"https://api.github.com/repos/tesseract-ocr/tesseract","labels_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/373/labels{/name}","comments_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/373/comments","events_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/373/events","html_url":"https://github.com/tesseract-ocr/tesseract/issues/373","id":166349370,"number":373,"title":"Glyphless font in pdf leads to spaces between characters","user":{"login":"ebogaard","id":4035997,"avatar_url":"https://avatars.githubusercontent.com/u/4035997?v=3","gravatar_id":"","url":"https://api.github.com/users/ebogaard","html_url":"https://github.com/ebogaard","followers_url":"https://api.github.com/users/ebogaard/followers","following_url":"https://api.github.com/users/ebogaard/following{/other_user}","gists_url":"https://api.github.com/users/ebogaard/gists{/gist_id}","starred_url":"https://api.github.com/users/ebogaard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebogaard/subscriptions","organizations_url":"https://api.github.com/users/ebogaard/orgs","repos_url":"https://api.github.com/users/ebogaard/repos","events_url":"https://api.github.com/users/ebogaard/events{/privacy}","received_events_url":"https://api.github.com/users/ebogaard/received_events","type":"User","site_admin":false},"labels":[{"id":384803307,"url":"https://api.github.com/repos/tesseract-ocr/tesseract/labels/PDF","name":"PDF","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-07-19T14:43:42Z","updated_at":"2016-11-29T14:41:57Z","closed_at":null,"body":"I try to use tesseract to directly generate pdfs with an ocr'ed text layer. This is one step of several how pdfsandwich creates searchable pdfs.\n\nThe result of the tesseract-subprocess, is a pdf with an image and a text layer and is perfectly searchable.\nProbably due to the high resolution input the dimensions of the resulting pdf are very large, which pdfsandwich solves by resizing the pages to more reasonable dimensions.\n\nAfter this resize, when I open this file in, for example, Acrobat Reader DC, all recognized text is separated by extra spaces. So when it used to read 'hello', now it reads 'h e l l o'. So when you search for hello, the text isn't found.\nA more technical explanation about this problem is in this thread: http://bugs.ghostscript.com/show_bug.cgi?id=696116\n\nI thought I had a work around for this, by specifying a smaller DW than the default 500:\n\n```\n--- api/pdfrenderer.cpp-orig       2016-07-14 14:55:53.299744815 +0200\n+++ api/pdfrenderer.cpp    2016-07-14 15:16:23.619204071 +0200\n@@ -543,7 +543,7 @@\n                \"  /FontDescriptor %ld 0 R\\n\"\n                \"  /Subtype /CIDFontType2\\n\"\n                \"  /Type /Font\\n\"\n-               \"  /DW %d\\n\"\n+               \"  /DW 250\\n\"\n                \">>\\n\"\n                \"endobj\\n\",\n                5L,         // CIDToGIDMap\n```\n\nThis solves the issue in Acrobat reader.\nBut when I put this file in Alfresco DMS, which uses [PDFBox](https://pdfbox.apache.org/) 1.8.4, I get the same problem again: I can only find words when I put spaces between the characters.\n\nSetting the DW to a number smaller than 250 compromizes the text in the ocr'ed layer, so that's no option.\n\nIs there any way to change the font type to a proper width, so most pdf-tools can properly read the text?\n"},"comment":{"url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/comments/263587877","html_url":"https://github.com/tesseract-ocr/tesseract/issues/373#issuecomment-263587877","issue_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/373","id":263587877,"user":{"login":"zdenop","id":574156,"avatar_url":"https://avatars.githubusercontent.com/u/574156?v=3","gravatar_id":"","url":"https://api.github.com/users/zdenop","html_url":"https://github.com/zdenop","followers_url":"https://api.github.com/users/zdenop/followers","following_url":"https://api.github.com/users/zdenop/following{/other_user}","gists_url":"https://api.github.com/users/zdenop/gists{/gist_id}","starred_url":"https://api.github.com/users/zdenop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdenop/subscriptions","organizations_url":"https://api.github.com/users/zdenop/orgs","repos_url":"https://api.github.com/users/zdenop/repos","events_url":"https://api.github.com/users/zdenop/events{/privacy}","received_events_url":"https://api.github.com/users/zdenop/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T14:41:57Z","updated_at":"2016-11-29T14:41:57Z","body":"In tessdata repository there are 4.00 data files and you use 3.05 tesseract...\r\nThis is not supported. You need to use data files from the same or lower tesseract version (e.g. 3.04)"}}
{"actor":{"display_login":"zdenop"}}