public String addTitleEps(String eps) throws IOException {
		if (text == null || text.size() == 0) {
			return eps;
		}

		final int idx = eps.indexOf("%%BoundingBox:");
		if (idx == -1) {
			throw new IllegalArgumentException();
		}
		final StringTokenizer st = new StringTokenizer(eps.substring(idx + "%%BoundingBox:".length()), " \n\t\r");
		final int x1 = Integer.parseInt(st.nextToken());
		final int y1 = Integer.parseInt(st.nextToken());
		final int x2 = Integer.parseInt(st.nextToken());
		final int y2 = Integer.parseInt(st.nextToken());
		assert x2 >= x1;
		assert y2 >= y1;

		final double width = x2 - x1;
		final double height = y2 - y1;

		final UGraphicEps uGraphicEps = new UGraphicEps(colorMapper, epsStrategy);
		final Dimension2D dimText = textBloc.calculateDimension(uGraphicEps.getStringBounder());
		final double xpos;

		if (horizontalAlignement == HorizontalAlignement.LEFT) {
			xpos = 2;
		} else if (horizontalAlignement == HorizontalAlignement.RIGHT) {
			xpos = width - dimText.getWidth() - 2;
		} else if (horizontalAlignement == HorizontalAlignement.CENTER) {
			xpos = (width - dimText.getWidth()) / 2;
		} else {
			xpos = 0;
			assert false;
		}

		final double yText;

		if (verticalPosition == VerticalPosition.TOP) {
			yText = 0;
		} else {
			yText = height + margin;
		}

		textBloc.drawU(uGraphicEps, xpos, yText);

		final double yImage;
		if (verticalPosition == VerticalPosition.TOP) {
			yImage = dimText.getHeight();
		} else {
			yImage = 0;
		}

		uGraphicEps.drawEps(eps, 0, yImage);

		uGraphicEps.close();
		return uGraphicEps.getEPSCode();

		// String svgTitle = CucaDiagramFileMaker.getSvg(uGraphicSvg);
		// svgTitle = svgTitle.replaceFirst("(?i)<g>", "<g
		// transform=\"translate(0 0)\">");
		//
		// if (verticalPosition == VerticalPosition.TOP) {
		// final Pattern p =
		// Pattern.compile("(?i)translate\\((\\d+)\\s+(\\d+)");
		// final Matcher m = p.matcher(svg);
		//
		// final StringBuffer sb = new StringBuffer();
		// while (m.find()) {
		// final int tx = Integer.parseInt(m.group(1));
		// final int ty = Integer.parseInt(m.group(2)) + (int)
		// (dimText.getHeight()) + margin;
		// m.appendReplacement(sb, "translate(" + tx + " " + ty);
		// }
		// m.appendTail(sb);
		// svg = sb.toString();
		// }
		//
		// final int x = svg.indexOf("<g ");
		// if (x == -1) {
		// throw new IllegalStateException();
		// }
		// svg = svg.substring(0, x) + svgTitle + svg.substring(x);
		//
		// return svg;
	}