public void mergeTo(int[] rowandcol) {
		if (rowandcol == null || rowandcol.length != 2){
			rowandcol = new int[]{1, 1};
		}
		this.pagesperpage = rowandcol[0] * rowandcol[1];
		PdfContentByte cb = pdfwriter.getDirectContent();
		float offsetX, offsetY, factorX, factorY;
		unitSize = new Rectangle(rectangle.getWidth() / rowandcol[1], rectangle
				.getHeight() / rowandcol[0]);
		int total = pdfreader.getNumberOfPages();
		factorX = unitSize.getWidth() / originSize.getWidth();
		factorY = unitSize.getHeight() / originSize.getHeight();

		// r: the row which iterator currently is;
		// temp: the page block which iterator currently is
		int r, temp;
		for (int i = 0; i < total;) {

			if (i % pagesperpage == 0) {
				document.newPage();
			}
			i++;
			offsetX = rectangle.getWidth() * ((i - 1) % rowandcol[1])
					/ rowandcol[1];
			temp = i % this.pagesperpage;
			r = 1;
			if (temp == 0)
				r = rowandcol[0];
			else {
				while ((temp - rowandcol[1]) > 0) {
					r++;
					temp -= rowandcol[1];
				}
			}
			offsetY = rectangle.getHeight() * (rowandcol[0] - r)
					/ rowandcol[0];
			page = pdfwriter.getImportedPage(pdfreader, i);
			cb.addTemplate(page, factorX, 0, 0, factorY, offsetX, offsetY);
		}
	}