// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java // The path to the documents directory. String dataDir = Utils.getDataDir(); // Create new XPS Document XpsDocument doc = new XpsDocument(); // Tile image // ImageBrush filled rectangle in the right top bellow XpsPath path = doc.addPath(doc.createPathGeometry("M 10,160 L 228,160 228,305 10,305")); path.setFill(doc.createImageBrush(dataDir + "R08LN_NN.jpg", new Rectangle2D.Float(0f, 0f, 128f, 96f), new Rectangle2D.Float(0f, 0f, 64f, 48f))); ((XpsImageBrush)path.getFill()).setTileMode(XpsTileMode.Tile); path.getFill().setOpacity(0.5f); // Save resultant XPS document doc.save(dataDir + "AddTiledImage_out.xps");