public String getContentOfSelectionAsPageNumberBlock(int x, int y, int height, int width) throws DoenstFitException, BadPageNumber {
        //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));
			
			PageNumberBlock new_block = new PageNumberBlock(tree, x, y, height, width);
			
			Scanner pageFinder = new Scanner(content);
			try {
				content = pageFinder.next("[0-9]+");
			} catch (Exception e) {
				throw new BadPageNumber();
			}
			
			if (content == null) {
				content = "0";
			}
			
			Line pageNumber = new Line(new_block, x, y, height, width);
			pageNumber.setContent(content);
			new_block.addChild(pageNumber);
			
			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;
		}
    }