private static Dimension getImposDimension(int rows, int cols, float width,
			float height, int rotation) {

		// if pages are rotated by 90 or -90 degrees, reverse width and height
		if (rotation == 90 || rotation == 270) {

			float w = width;
			width = height;
			height = w;
		}

		int verticalSeparatorsCount = cols - 1;
		int horizontalSeparatorsCount = rows - 1;
		// Rectangle rv = new Rectangle();
		float imposWidth = 0;
		float imposHeight = 0;
		int txfCountHorz = cols + 1;
		int txfCountVert = rows + 1;

		// testiniai komponentai ju dydziu paskaiciavimui
		// skaiciuojame text fieldu plocius
		for (int i = 0; i < txfCountHorz; i++) {

			imposWidth += 100;
		}

		// skaiciuojame text fieldu aukscius
		for (int i = 0; i < txfCountVert; i++) {

			imposHeight += 50;
		}

		// skaiciuojame separatoriu plocius
		for (int i = 0; i < verticalSeparatorsCount; i++) {

			// imposWidth += rv.width;
			imposWidth += 20;
		}

		for (int i = 0; i < horizontalSeparatorsCount; i++) {

			// imposHeight += rv.height;
			imposHeight += 20;
		}

		// pridedame puslapio ismatavimus
		for (int i = 0; i < cols; i++) {

			imposWidth += width;
		}

		for (int i = 0; i < rows; i++) {

			imposHeight += height;
		}

		return new Dimension((int) imposWidth, (int) imposHeight);
	}