Open zuphilip opened 6 years ago
I'll jump on here, would love the ability to programmatically activate/disable elements instead of clicking on the sidebar.
Currently, it is not possible to enable/disable features at load time.
However, the viewer is a Vue.JS application, assigned to window.hocrapp
, which you can use to programmatically execute the methods, such as toggleFeature
:
const viewer = window.hocrapp.$children[0]
viewer.toggleFeature('BackgroundImage')
or to navigate through multi-page hOCR:
viewer.nextPage()
viewer.prevPage()
or zoom
viewer.zoom(.75)
viewer.zoom('height')
viewer.zoom('reset')
etc. See vue-hocr/src/components/HocrViewer/script.js
for the API.
Awesome, thanks!
I have a hocr file and want to add the hocrjs interface with some predefined options. To integrate it I add
<script src="https://unpkg.com/hocrjs"></script>
at the end before the closing</body>
tag. But can I also enable or disable some of the options, e.g. enable the background image for that specific hocr file?