Connector draws strangley

Hello,


I’m using version 14.2.0 of Aspose.Slides for .NET to create connected shapes using ‘ShapeType.CurvedConnector3’.

The connections are established properly, but the connector is drawn in an unexpected way, right after opening the PPTX. As soon I move one of the connected shapes within PowerPoint, the connector redraws correctly. This behavior may be okay, when saving as PPTX, but when we want to save it as PDF, the output is not what we expect.

I’ve attached an example created by our application.

How can we workaround this behavior?

Best regards,
Daniel

Hi Daniel,


I have worked with the presentation file shared by you and have tried exporting that to PDF. I have not been able to observe the issue on my end while exporting presentation to PDF using Aspose.Slides for .NET 14.2.0 on my end. For your kind reference, the generated PDF is also attached. Please try using the attached version on your end to serve the purpose.

I also like to add further that the support for associating connector to shape is unavailable in Aspose.Slides and for that an issue with ID SLIDESNET-31745 has already been added in our issue tracking system to provide requested support.

Please share, if I may help you further in this regard.

Many Thanks,

Hello Mudassir,


I think you misunderstood me. I have no problem with saving as PDF. It was only a note, that the described problem is annoying for saving as PDF, because you can’t modify the output. In PPT you can correct the drawing issue manually, by dragging a connected item. The PDF output itself visually matches the PPT output, but the PPT output isn’t 100% correct (see how the connectors are drawn right after opening the PPTX and compate it to how they are drawn after moving a connected shape).

On the other hand, I don’t understand your statment regarding the missing support of connecting shapes. It works in the Unified API version, as you can see in my example, but not at 100%.

Thanks

Hi Daniel,


I am sorry for the inconvenience. I have revisited your sand have performed the following steps on my end in order to reproduce the issue.

  1. Opened up Export.pptx using Aspose.Slides for .NET 14.2.0 and exported to PDF- No issue observed in generated PDF (Export.pptx.pdf).
  2. Opened up Export.pptx in PowerPoint 2010 and moved connected shapes. This re-adjusted connectors and saved it as Export2.pptx.
  3. Opened up Export2.pptx using Aspose.Slides for .NET 14.2.0 and exported to PDF- No issue observed in generated PDF (Export2.pptx.pdf).

I am sorry if I have not been able to understand your comments properly. I request you to please share the sample presentations for both scenarios, generated PDF and used sample code on your to avoid ambiguity. Please also highlight the incurring issue as well. I will be glad to help you further in this regard.

As far as your comments regarding support for connectors is concerned, I like to share that we are still working over feature for connecting shapes to connector.

Please share, if I may help you further in this regard.

Many Thanks,

Hi Mudassir,


Point 2. is exactly the issue I complain about, not the PDF export. You need to move a connected shape to have a correctly drawn connector in PowerPoint. So if you are still working on the connection feature, you should be aware of this issue.

Best regards,

Daniel

Hi Daniel,


I have got your point and like to share that this is the reason for which SLIDESNET-31745 has been created. At present we can add connectors but cannot hook them to shapes. When the sad issue will be resolved , whenever the shape is moved using Aspose.Slides and it is connected to a connector, the connector will re-adjust it self.

I hope this will clarify the point. Please share, if I may help you further in this regard.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-31745) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(1)

Hi,

looks like the issue has been solved for .NET. However, I came across the same issue using Aspose.Slides for Java (tried out and found in 17.2, 18.5 and 18.7). Please find a sample ppt attached.

mytest.zip (24.9 KB)

@Owirtz,

I have observed the presentation file shared by you and request you to please share the used sample code and generated output for reference. Please also first try using Aspose.Slides for Java 18.7 as well on your end.

Thanks,
please find some sample code below.

Presentation pres = new Presentation();

	// Get the first slide
	ISlide sld = pres.getSlides().get_Item(0);

	// Add AutoShape of ellipse type
	IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 100, 100, 50);
			
	IShape shp1 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 200, 100, 50);
	
	IShapeCollection shapes = pres.getSlides().get_Item(0).getShapes();
	
	IConnector connector = shapes.addConnector(ShapeType.Line, 100, 100, 100, 100);
	connector.getLineFormat().setEndArrowheadStyle(LineArrowheadStyle.Triangle);
	connector.getLineFormat().getFillFormat().setFillType(FillType.Solid);
	connector.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK);
	
	connector.setStartShapeConnectedTo(shapes.get_Item(0));
	/*int tempx=(int) shapes.get_Item((int) istop).getX()+1;
	shapes.get_Item((int) istop).setX(tempx);*/
	connector.setEndShapeConnectedTo(shapes.get_Item(1));
	connector.setStartShapeConnectionSiteIndex(2);
	connector.setEndShapeConnectionSiteIndex(0);
	
	// Write the PPTX file to disk
	pres.save("C:/Temp/" + "mytest.pptx", SaveFormat.Pptx);

The attached file shows the output.mytest.zip (21.5 KB)
The end of the connector does not attach exactly at position 0 of the second shape. If you move the shape manually the connector is re drawn and attaches in the correct place.

@Owirtz,

I have worked with source code shared by you using Aspose.Slides for Java 18.7 and have been able to observe issue. An issue with ID SLIDESJAVA-37311 has been added in our issue tracking system to further investigate and help you out in this matter. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are currently using Aspose.Slides .Net version 18.8.0.0 and are also seeing an issue where vertical connectors are not quite being draw accurately. We have two identical shapes vertically aligned. A connector is drawn between the bottom of the top shape and the top of the bottom shape. When you open the pptx the line is not completely vertical. When you grab either end of the connector with the pointer it “snaps” to the connector poin on the shape.

I thought this had been resolved in the .Net version. An I missing something?

@smanton,

I have observed the issue shared by you and request you to please share the source presentation, used sample code, generated output along with depiction of issue in the form of image. We will be able to investigate the issue further on our end on provision of requested information. Before this, I also request you to please try using latest Aspose.Slides for .NET 18.8 on your end.

I have attached a zip file containing an example project and a pdf output the of slide that is generated.

ConnectorSample.zip (62.9 KB)
output.pdf (69.8 KB)

The project generates a simple slide with two shapes and a connector from the bottom site of the top shape to the top site of the bottom shape. The connector is drawn slanting to the right. We would expect this to be vertical.

As a test we opened the pptx in PowerPoint and duplicated the slide. On the second slide we double clicked the end point of the connector which straightens the connector. We then saved the slide again. This pptx has been included in the zip and help to highlight the correction.

To investigate further I renamed the pptx to zip to allow me to unpack the OpenXml. I used a tool to compare the Xml for the original Slide 1 and Corrected slide 2 to see the effect the manual correction to the connector makes to the underlying Xml.

The Xml for the connector as generated by Aspose.Slides is

		<p:cxnSp>
			<p:nvCxnSpPr>
				<p:cNvPr id="4" name="New connector"/>
				<p:cNvCxnSpPr>
					<a:stCxn id="2" idx="2"/>
					<a:endCxn id="3" idx="0"/>
				</p:cNvCxnSpPr>
				<p:nvPr/>
			</p:nvCxnSpPr>
			<p:spPr>
				<a:xfrm>
					<a:off x="889000" y="889000"/>
					<a:ext cx="12700" cy="127000"/>
				</a:xfrm>
				<a:prstGeom prst="straightConnector1">
					<a:avLst/>
				</a:prstGeom>
				<a:ln w="12700"/>
			</p:spPr>
			<p:style>
				<a:lnRef idx="1">
					<a:schemeClr val="accent1"/>
				</a:lnRef>
				<a:fillRef idx="0">
					<a:schemeClr val="accent1"/>
				</a:fillRef>
				<a:effectRef idx="0">
					<a:schemeClr val="accent1"/>
				</a:effectRef>
				<a:fontRef idx="minor">
					<a:schemeClr val="tx1"/>
				</a:fontRef>
			</p:style>
		</p:cxnSp>

The Xml for the connector is the corrected slide is

<p:cxnSp>
<p:nvCxnSpPr>
<p:cNvPr id=“4” name=“New connector”/>
<p:cNvCxnSpPr>
<a:cxnSpLocks/>
<a:stCxn id=“2” idx=“2”/>
<a:endCxn id=“3” idx=“0”/>
</p:cNvCxnSpPr>
<p:nvPr/>
</p:nvCxnSpPr>
<p:spPr>
<a:xfrm>
<a:off x=“889000” y=“889000”/>
<a:ext cx=“0” cy=“127000”/>
</a:xfrm>
<a:prstGeom prst=“straightConnector1”>
<a:avLst/>
</a:prstGeom>
<a:ln w=“12700”/>
</p:spPr>
<p:style>
<a:lnRef idx=“1”>
<a:schemeClr val=“accent1”/>
</a:lnRef>
<a:fillRef idx=“0”>
<a:schemeClr val=“accent1”/>
</a:fillRef>
<a:effectRef idx=“0”>
<a:schemeClr val=“accent1”/>
</a:effectRef>
<a:fontRef idx=“minor”>
<a:schemeClr val=“tx1”/>
</a:fontRef>
</p:style>
</p:cxnSp>

There are a couple of differences. I think the added to the Locks element is not important however on the corrected slide the cx property of the a:ext element was been changed to 0.

Therefore for whatever reason it appears that the value of 12700 that Aspose is writing out is the cause of the slanting line.

Can you investigate and get back to me.

Thanks

@smanton,

I have observed the information shared by you. Actually, this is not an issue but requires imparting clarification. You have to give the connection sites on the shapes where you want to add connectors. The connection sites are in center of any shape side line. So, when you give two points they get connected and it is not necessarily a straight line. You can verify this by adding two shapes of same size but only change Y position. Then you add connector for that and you will find the vertical. I hope the shared elaboration will be helpful.

In the example the two shapes being connected are of the same size and it is only the Y position that has been changed. Therefore based on your explanation the line should be vertical, but as you can see from our example the line is not vertical. This is the issue.

@smanton,

Thank you for the elaboration. I have been able to reproduce the issue on my end. An issue with ID SLIDESNET-40544 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Hi,

I just wanted to catch up on ID SLIDESJAVA-37311. Are there any news regarding the issue?
Thanks
Oliver

@Owirtz,

I have verified the issue status from our issue tracking system and regret to share that issue is still unresolved owing to internal blocking issue. We request for your patience till the time the issue gets resolved.

Can you share a timeline of when this will be fixed?