Aspose Word Java Save Shape as Tif

Dear team,

I’m trying to save the shapes attached to the document as tiff images. However reading the document, I have the impression that I can

  • Either save the shape (if it has image data) in the same format as the image is using the save method of the associated Image Data

  • Or use the ShapeRenderer class, which allows to save only as PNG, BMP, JPG or SVG. Save as TIFF does not seem to be possible.

Is there any solution for this issue?

Kind regards

Patrick

@PatrickVB,

You can use the following code to save Shape as TIFF image:

Document doc = new Document("D:\\temp\\Doc1.docx");
Shape shape = (Shape) doc.getChildNodes(NodeType.SHAPE, true).get(0);
ShapeRenderer renderer = shape.getShapeRenderer();
renderer.save("D:\\Temp\\img.tiff", new ImageSaveOptions(SaveFormat.TIFF));

Please make sure that native JAI and ImageIO are installed on your end (see System Requirements)

Works as expected.
Great.
Thanks

Patrick