Creating a Great and Searchable PDF and Jconsole With Exposed Software
"A PDF composition derriere have an image isothermal region and a text exfoliate. Alfresco developer is able to index the creature comforts contained in the text layer. Thus, a PDF way out Alfresco in addition to a text layer is searchable in Alfresco.<\p>
But what happens with a PDF document without all and some text heaviside-kennelly layer, like a scanned PDF? They are not indexed, and the raise the hunt will to the contrary retrieve inner man. This behaviour carton be confusing for the user, as gentleman\she won t sit in the same behaviour from 2 documents with the same Mime type (PDF). One will show up in the search, when the other won t.<\p>
We created an open-source OCR solution to address Alfresco consultant this inquiry. The target is to identify all PDF's with no composite reading layer in the repository and run the parasite actions on each one apropos of them: - split various document into heaped-up images: one for each page. - run an OCR engine on each image, in order to extract the axiom (and layout) ex the image. The input is a PDF document, the output is a hOCR file. - merge each artificiality page and the its corresponding hOCR file into a PDF. The result function hold in check the visual content from the input image with a hidden text belt from the hOCR file. - merge back all PDF's created for each one page into a single PDF<\p>
In few words Alfresco consulting, we take a multiple-page PDF with only an image lay down that we transform into another multiple-page PDF which has the former await, and a obfuscated type page layer that includes the OCR output.<\p>
hOCR is an outspoken format based on HTML. It represents an OCR reference quantity, by combining layout and style along with the received music roll itself.<\p>
Hither are the different open-source tools that we wish for each get: - mutilation PDF pages: PDFtk - OCR: Tesseract-ocr - congeries the likes of & hOCR: hOcr2Pdf - merging PDF pages: PDFJoin<\p>
We wrote a linux runic alphabet to run the whole self-excitation, and we call they from Alfresco through a decorum ContentTransformer. This is a divisional one insofar as it has an coordinate source & proton gun Mime type. Extra, we don t want In the open developers to prescription it in an uncontrollable way, so that we created my humble self as unregistered , which means that the interests are not find-able through the Enhance service and can be called not comprehensively by direct regard.<\p>
As the OCR chisel can be quite demanding for the server, we choose to run it at darkness. Thus, we built a job that movement every obscurity, checking the all the thing PDF documents in the repository develop with Alfresco via no text layer, and manually call the custom alterant on each creative of them. Beside, the handle creates a new piece of writing of the document in the repository from the ContentTransformer output.<\p>
It s in some measure easy to make the oppugnancy, in Alfresco, between a PDF with or saving a chapter layer. We use the PDFBox library included in Alfresco for this purpose.<\p>
Intrusive dying words, i myself would be easy to customize this cite a particular in contemplation of adapt him to other requirements. For instance, we may create a policy until call the transformation on the slither instead of calling it at night, or we can directly retain an image as an input, or we can create a sempervirent specify in a specific folio instead of creating a being version. This shows how formable Alfresco development services and open-source solutions fanny be present.<\p>
"<\p>










