I have attached a pptx file “icon_issue.pptx” having one icon shape in the first slide. When I open this pptx file using aspose and just try to save it again, it throws the below exception:
DashPattern value is not valid.
Please let us know why this error is occurring and how can we resolve this issue?
Additionally, during our debugging we found that the problem might be because of the svg data of the icon. Hence, we extracted the svg data of this icon using below code:
presentation.slides[0].shapes[0].picture_format.picture.image.svg_image.svg_content
The output svg_content data is attached in a file “svg_content.txt”.
In this svg content we noticed that if we replace the below content:
stroke-dasharray=“0 7.5”
with
stroke-dasharray=“0.1 7.5”
and replace this new svg content in the same svg image. After that if we try to save the presentation, it gets saved successfully i.e. no exception is thrown.
Please advise why this is happening and how can this be fixed from aspose side so that no exception is thrown in the first place ?
SVG issue.zip (1.4 MB)
@Prezent_Inc
The error message “DashPattern value is not valid” that you are encountering when saving the presentation is likely related to the SVG data of the icon shape in your PowerPoint file. It appears that the specific value used in the stroke-dasharray
attribute of the SVG content is causing the issue.
From your debugging, you found that changing the stroke-dasharray
value from 0 7.5
to 0.1 7.5
resolves the error, allowing the presentation to save successfully. This suggests that the original value of 0
is not being handled correctly by the Aspose.Slides library.
To address this issue from the Aspose side, you can consider the following options:
-
Update Aspose.Slides: Ensure you are using the latest version of Aspose.Slides, as updates often include bug fixes and improvements. Check the release notes for any fixes related to SVG handling or dash patterns.
-
Modify SVG Content: As a workaround, you can programmatically modify the SVG content before saving the presentation. This can be done by replacing the problematic stroke-dasharray
value with a valid one, as you have already discovered.
-
Report the Issue: If this is a recurring problem, consider reporting it to Aspose support with detailed information, including the SVG content and the steps to reproduce the issue. This can help the development team address the underlying problem in future releases.
If you need further assistance or have additional questions, feel free to ask!
@Prezent_Inc,
I need some time to check the issue. I will get back to you as soon as possible.
@Prezent_Inc,
Thank you for your patience. Unfortunately, I was unable to reproduce the error you described. With Aspose.Slides for Python via .NET 25.4, I used the following code example:
with slides.Presentation("icon_issue.pptx") as presentation:
presentation.save("output.pptx", slides.export.SaveFormat.PPTX)
No errors occurred on my end.
Please share the following additional information:
- code example to reproduce the error
- OS version on which the exception occurs
- Python version you used
- Aspose.Slides version you used