buffer.append (segment.substring(pageIndex + PageTagLength));
buffer.append (segment.substring(pageIndex + pageTagLength));
	void printDecorationSegment(String segment, int alignment, int page, boolean header) {				int pageIndex = segment.indexOf(StyledTextPrintOptions.PAGE_TAG);				if (pageIndex != -1) {			final int PageTagLength = StyledTextPrintOptions.PAGE_TAG.length();			StringBuffer buffer = new StringBuffer(segment.substring (0, pageIndex));			buffer.append (page);			buffer.append (segment.substring(pageIndex + PageTagLength));			segment = buffer.toString();		}		if (segment.length() > 0) {			int segmentWidth;			int drawX = 0;			int drawY = 0;			TextLayout layout = new TextLayout(printer);			layout.setText(segment);			layout.setFont(printerFont);			segmentWidth = layout.getLineBounds(0).width;			if (header) {				drawY = clientArea.y - renderer.getLineHeight() * 2;			}			else {				drawY = clientArea.y + clientArea.height + renderer.getLineHeight();			}			if (alignment == LEFT) {				drawX = clientArea.x;			}			else							if (alignment == CENTER) {				drawX = (pageWidth - segmentWidth) / 2;			}			else 			if (alignment == RIGHT) {				drawX = clientArea.x + clientArea.width - segmentWidth;			}			layout.draw(gc, drawX, drawY);			layout.dispose();		}	}