Free Support Forum - aspose.com

Text wrap issue with Aspose.Diagram


#1

Hi,

Recently, I have upgraded Aspose.Diagram to version 18.11 from version 16.11. Since then, I am facing text wrapping issue on the diagram.
Here is the code snippet:
currentShape.Text.Value.Clear();
currentShape.Chars.Clear();
currentShape.TextBlock.TextDirection.Value = TextDirectionValue.Horizontal;
currentShape.TextBlock.VerticalAlign.Value = VerticalAlignValue.Middle;
currentShape.Text.Value.Add(new Cp(0));
currentShape.Text.Value.Add(new Txt(“Shelf\r\nPartNumber Description”));
currentShape.Chars.Add(new Aspose.Diagram.Char());
currentShape.Chars[0].IX = 0;
currentShape.Chars[0].Color.Value = color;
currentShape.Chars[0].Font.Value = 3;
currentShape.Chars[0].Style.Value = StyleValue.Bold;
currentShape.TextXForm.TxtWidth.Value = currentShape.XForm.Width.Value;
currentShape.TextXForm.TxtPinX.Ufe.F = “Width*0.5”;

The text “Shelf\r\nPartNumber Description” comes in 3 lines like
Shelf
PartNumber
Description

The same code works perfect with version 16.11. like
Shelf
PartNumber Description

What is the reason for wrapping of the text in the new dll version?
Please suggest

Thanks,
Sharanya


#2

@sharanya_ps

Thanks for contacting support.

Would you kindly share complete code snippet along with source and output Diagram file. We will test the scenario in our environment and address it accordingly.


#3

Hi,

I am not able to upload my project. It us around 15 MB after zipping.
Please suggest

Thanks,
Sharanya


#4

@sharanya_ps

You may please upload your sample project to Dropbox or Google Drive and share the link with us.


#5

Here is the Google drive link for the project solution.
https://drive.google.com/file/d/1C77ORkA1u6ohIJ-mAlSnK0BWQcAaUTHn/view?usp=sharing

There is a document ‘HowToRun.docx’ which has the steps for running the project. And the output file is Visio.vdx

Thanks,
Sharanya


#6

@sharanya_ps

Thanks for sharing sample project.

We have tried to run the project by guiding the instructions in .docx file but the project files were not loaded correctly in Visual Studio. ProjectLoadingIssue.png (9.7 KB) It is requested if you can please share simplified code snippet showing the basic functionality where your issue is occurring. You may also share a simple console application able to reproduce the issue. We will definitely test it in our environment and address it accordingly.


#7

Hi,
Below is the simplified version of the project. It is a console application.
https://drive.google.com/file/d/1Wh-S9In6ZUotRlc0iUAv6v3MMQ-Bjv32/view?usp=sharing

Let me know if you have any questions.

Thanks,
Sharanya


#8

@sharanya_ps

Thanks for sharing sample project.

We have tested the scenario in our environment and noticed that text on shape was appearing in two lines. Furthermore, we have also tried to replace the text with larger string i.e. "Shelf\r\nPartNumberPartNumber Description" and it was still appeared on two lines. For your kind reference, an output file is also attached.

Visio.zip (535.1 KB)

Could you please highlight more about the issue you are facing. You may please share a screenshot showing the actual issue and an output file, generated at your end. This would help us replicating the issue in our environment and address it accordingly.


#9

Visio.zip (551.3 KB)
Attached is the output when I tried generating the Visio. You can notice that in ‘Cabinet 2’ the text is displaying in 3 lines.
This issue randomly occurs with the latest Aspose.Diagram dll version 18.11.
We can never reproduce the issue with the dll version 16.11

Thanks,
Sharanya


#10

@sharanya_ps

Thanks for writing back.

We have checked the diagram shared by you and were still unable to notice text in 3 lines. Please check the screenshot displaying text in “Cabinet 2”.TextInTwoLines.png (35.0 KB)

Please note that the latest version of the API is 19.1. You may also try using it and check if resolves your issue. Since, it randomly occurs at your end, it seems your environment specific issue. It would be helpful if you could please share some information about your environment (e.g. OS Version and Name, Software you are using to view diagrams, etc.). We will again try to replicate it in our environment and proceed further to help you out.


#11

Hi,

I hadn’t my luck with the latest version of the API as well.
I am running on Windows 10 and using MS Visio 2010 to open the output.

May I request you to add more shelves to the cabinet, which may help you to reproduce the issue? The logic should be pretty easy if you follow the code.

Thanks again,
Sharanya


#12

@sharanya_ps

Thanks for your feedback.

We will further try to replicate the issue in our environment using the way you suggested. As soon as we have some findings, we will share with you. Please spare us little time.


#13

Please keep me updated if there is a resolution for the above issue

Thanks much,
Sharanya


#14

@sharanya_ps

We have tried to add following line of code in the existing method DoFrontView() of your program but it did not add new shelf inside the Cabinet.

ShelfFrontViewDrawer sfvd7 = new ShelfFrontViewDrawer(visioEngine, "DS224C", "960GB SSD", this.cabinetShapes[cabinetShapeIndex]);
sfvd7.DrawShape(visioEngine, 7, "DS224C", 2);

Would please guide us a bit more if we are missing something in your earlier shared console application.


#15

Could you please try opening the document in MS Visio 2016 and check whether the issue occurs?

Thanks,
Sharanya


#16

@sharanya_ps

We have checked the file by opening it in MS Visio 2016 and issue did not occur.

2LinesText.png (27.2 KB)
MSVisioVersion.png (1.3 KB)

Would you please share the output VSDX file generated at your end along with the screenshot of issue you are experiencing at your end.


#17

Here is another project where the issue is reproduced while opening in MS Visio 2016.
https://drive.google.com/file/d/1Wh-S9In6ZUotRlc0iUAv6v3MMQ-Bjv32/view?usp=sharing

Visio.zip (823.1 KB)

Visio.zip is the output file generated.

Capture.PNG (31.8 KB)

Capture.png is the screenshot of how it looks when I open the Visio

Thanks,
Sharanya


#18

@sharanya_ps

Thanks for sharing sample project.

We have tested the scenario again in our environment using recently shared project and Aspose.Diagram for .NET 19.1. We were able to observe the issue at our side and have logged it as DIAGRAMNET-51608 in our issue tracking system for the sake of correction. We will look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.


#19

Thank you for acknowledging the issue.

I have observed one more issue. If I copy the image from Visio to Powerpoint, the image gets distorted. The issue occurs only with the Aspose.Diagram version 18.11. Below is the Powerpoint slide which has the copied Visio image
CopyFromVisioAsposeDiagramVer18.11.zip (646.3 KB)

Below is the slide which has the copied Visio image which is generated with Aspose.Diagram version 16.11. The copied image looks fine here.
CopyFromVisioAsposeDiagramVer16.11.zip (649.5 KB)

We have Enterprise license with Aspose. Let me know if you want me to share the license details.

Please suggest

Thanks,
Sharanya


#20

@sharanya_ps

Thanks for getting back to us.

We have tried to copy the image from Diagram produced by 19.1 version of the API and were unable to notice the text distortion issue. We have performed following steps:

  • Open Diagram using MS Visio 2016
  • Press Ctrl + A to select all content and Ctrl + C to copy
  • Open new blank blank presentation in MS Power Point 2016
  • Ctrl + V to paste the copied Diagram

CopyFromVisioAsposeDiagramVer19.1.zip (661.5 KB)
Visio.zip (823.1 KB)

For your kind reference, both Diagram and PPTX files are attached. Would you please share how you are copying the diagram into PowerPoint Slide or trying doing same with the Diagram generated with latest version of the API. Please share your feedback so that we can proceed further to assist you accordingly.