public String getContentOfSelectionAsBlock(int x, int y, int height, int width) throws DoenstFitException {
        //Outside of image
        if (x > img.getWidth() || y > img.getHeight())
            return null;

        if (height + y > img.getHeight())
            height = img.getHeight() - y;

        if (width + x > img.getWidth())
            width = img.getWidth() - x;

        try {
            String content = instance.doOCR(img.getSubimage(x, y, width, height));

            Block new_block = new Block(tree, x, y, height, width);

            String[] lines = content.split("\n");

            int line_height = height / lines.length;

            for (int i=0, lineY = y; i < lines.length; i++, lineY+=line_height) {
                new_block.addChild(
                        new Line(lines[i], new_block, x, lineY, line_height, width));
            }

            if (tree.fits(new_block))
                tree.addChild(new_block);
            else {
                System.err.println(new_block.getLeftUpperCornerX() + " " +
                        new_block.getLeftUpperCornerY() + " " + new_block.getWidth() + " " + new_block.getHeight());
                throw new DoenstFitException();
            }


            return content;
        } catch (TesseractException e) {
            e.printStackTrace();
            return null;
        }
    }