Render Multiple Shapes as a Single Image

Hi,

I am using Aspose.words Java library. I want to render overlapping shapes in a word document as a single image. I could see ShapeRenderer class which can render a Shape as an image. But, I want to render multiple overlapping shapes as a single image. Could you assist me on this?

Hi there,

Thanks for your inquiry. In this case, you can convert the whole document’s page into image. Following code example shows how to convert first page of document into image.

If this does not help you, please share your input Word document along with expected output document. We will then provide you more information about your query.

Document doc = new Document(MyDir + "input.docx");

ImageSaveOptions options = new ImageSaveOptions(SaveFormat.PNG);
// ImageSaveOptions.PageIndex  gets or sets the 0-based index of the first page to render
options.setPageIndex(0);
options.setPageCount(1);

doc.save(MyDir + "output.png", options);