Hi All,
The current SVG output (Aspose.Words) seems fixed to the paper size and does not seem to resize when the window changes. To get around this (I want small versions of the original SVG images) I have to add the following to the SVG document (it seems like a hack)
preserveAspectRatio=“xMinYMin meet” viewBox=“0 0 794 1123”
Is there an easier way of achieving an SVG that scales to the parent window?
Thanks
Mark
The code I use
List<byte[]> singlePreviewImages = new LinkedList<byte[]>();
ByteArrayInputStream bais = new ByteArrayInputStream(entity.getData().getBytes());
Document doc = new Document(bais);
com.aspose.words.SvgSaveOptions svgSaveOptions = new com.aspose.words.SvgSaveOptions();
svgSaveOptions.setExportEmbeddedImages(true);
svgSaveOptions.setPageCount(1);
for (int i = 0; i <= doc.getPageCount() - 1; i++)
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
svgSaveOptions.setPageIndex(i);
doc.save(baos, svgSaveOptions);
singlePreviewImages.add(baos.toByteArray());
}