Hello,
i have a mastershape consisting of several hundred shapes.
If i drop this mastershape out of the vssx-file to a page by visio everything looks good. Even when I insert this master shape into a page using Microsoft.Office.Interop.Visio, it looks fine.
But if i drop this mastershape to a page by aspose.diagram some of the containing shapes are shown streched out. I haven’t noticed this behaviour with any of my other master shapes.
To give you an example, I have stripped down the master shape so that only the problematic shapes remain.
I’ve attached my vssx-file. Can you tell me why the shape looks normal in Visio when I add it to the page, but looks stretched when using Aspose.Diagram?
Diagram diagram = new Diagram();
diagram.AddMaster("test_master.vssx", "test");
Aspose.Diagram.Master master = diagram.Masters.GetMasterByName("test");
Aspose.Diagram.Page newPage = new Aspose.Diagram.Page();
newPage.Name = "MasterTestPage";
int PageWidth = 210; //mm
int PageHeight = 297; //mm
DoubleValue PageWithMeasured = new DoubleValue(PageWidth, MeasureConst.MM);
DoubleValue PageHeightMeasured = new DoubleValue(PageHeight, MeasureConst.MM);
newPage.PageSheet.PageProps.PageWidth.Value = PageWithMeasured.Value;
newPage.PageSheet.PageProps.PageHeight.Value = PageHeightMeasured.Value;
newPage.PageSheet.PrintProps.PrintPageOrientation.Value = PrintPageOrientationValue.Portrait;
diagram.Pages.Add(newPage);
long shapeId = newPage.AddShape(0, 0, "test");
// Position the form centrally
Aspose.Diagram.Shape masterShape = newPage.Shapes.GetShape(shapeId);
masterShape.XForm.PinX.Value = newPage.PageSheet.PageProps.PageWidth.Value / 2;
masterShape.XForm.PinY.Value = newPage.PageSheet.PageProps.PageHeight.Value / 2;
diagram.Save("mastertest.vsdx", SaveFileFormat.Vsdx);
Thank you for providing detailed information about your issue. It seems there might be a discrepancy between how Aspose.Diagram and Microsoft Visio handle the rendering of certain shapes.
Troubleshooting Steps
Check Shape Data:
Ensure that the shape data in your master shape is correctly configured. Sometimes, missing or incorrect shape data can cause rendering issues.
Examine Shape Transformation:
Double-check the transformation properties (XForm) of the shapes within your master shape. There might be a discrepancy in how Aspose.Diagram handles these properties compared to Visio.
Review Master Shape Settings:
Verify that the master shape settings, such as pins and controls, are correctly defined and do not have any anomalies.
Example Code Review
Here is a refined version of your code to ensure that it is correctly setting up the master shape and adding it to the page:
Diagram diagram = new Diagram();
diagram.AddMaster("test_master.vssx", "test");
Aspose.Diagram.Master master = diagram.Masters.GetMasterByName("test");
Aspose.Diagram.Page newPage = new Aspose.Diagram.Page();
newPage.Name = "MasterTestPage";
int pageWidth = 210; // mm
int pageHeight = 297; // mm
DoubleValue pageWidthMeasured = new DoubleValue(pageWidth, MeasureConst.MM);
DoubleValue pageHeightMeasured = new DoubleValue(pageHeight, MeasureConst.MM);
newPage.PageSheet.PageProps.PageWidth.Value = pageWidthMeasured.Value;
newPage.PageSheet.PageProps.PageHeight.Value = pageHeightMeasured.Value;
newPage.PageSheet.PrintProps.PrintPageOrientation.Value = PrintPageOrientationValue.Portrait;
diagram.Pages.Add(newPage);
long shapeId = newPage.AddShape(0, 0, "test");
// Position the form centrally
Aspose.Diagram.Shape masterShape = newPage.Shapes.GetShape(shapeId);
masterShape.XForm.PinX.Value = newPage.PageSheet.PageProps.PageWidth.Value / 2;
masterShape.XForm.PinY.Value = newPage.PageSheet.PageProps.PageHeight.Value / 2;
diagram.Save("mastertest.vsdx", SaveFileFormat.Vsdx);
Additional Resources
For further troubleshooting, you may refer to the following Aspose.Diagram documentation resources:
If the issue persists, please provide more details about the shape properties and any specific configurations that might be affecting the rendering. This will help us provide a more accurate solution.
Best regards,
[Your Name]
Aspose Technical Support
@sgruth
Thank you for providing the file and pointing out the issue.
We reproduced the problems you mentioned by running the sample code.
There is an issue with the formula parsing .We will evaluate your issue further.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): DIAGRAMNET-53787
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you have found earlier (filed as DIAGRAMNET-53787) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou