Open Alduin-Y opened 8 months ago
@Alduin-Y Actually, the code you are using does not convert JPEG to SVG. ImageData.save
method saves the images in the original format, so the Output.svg
file will be simply a JPEG file with SVG extension. If you need to wrap your JPEG to SVG, you can use ShapeRenderer:
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
shape = builder.insert_image("C:\\Temp\\in.jpg")
shape.get_shape_renderer().save("C:\\Temp\\out.svg", aw.saving.ImageSaveOptions(aw.SaveFormat.SVG))
Also, please note, there is no way to vectorize raster images using Aspose.Words.
@Alduin-Y Actually, the code you are using does not convert JPEG to SVG.
ImageData.save
method saves the images in the original format, so theOutput.svg
file will be simply a JPEG file with SVG extension. If you need to wrap your JPEG to SVG, you can use ShapeRenderer:doc = aw.Document() builder = aw.DocumentBuilder(doc) shape = builder.insert_image("C:\\Temp\\in.jpg") shape.get_shape_renderer().save("C:\\Temp\\out.svg", aw.saving.ImageSaveOptions(aw.SaveFormat.SVG))
Also, please note, there is no way to vectorize raster images using Aspose.Words.
Running successfully! thank you very much.
When I try to see the code inside
Unable to obtain correct results using examples from the official website The code source is here: https://products.aspose.com/words/zh/python-net/conversion/image-to-svg/#codeSnippetAnchor