|
|
Connector Issue
Last post 06-04-2008, 5:26 AM by mosfiqur. 11 replies.
-
05-06-2008, 5:33 AM |
-
05-07-2008, 5:45 AM |
-
msfaiz
-
-
-
Joined on 02-01-2007
-
-
Posts 2,275
-
-
-
-
|
Re: Connector Issue
Attachment: Present (inaccessible)
Dear Mosfiqur,
I have checked, the code works perfectly as it is expected. I have attached the code in C# and the output presentation generated by it.
C# CODE
------------------------------------------------------------------------------------------------
using System;
using System.IO;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using Aspose.Slides;
namespace PPTAsposePractice
{
class PPTPractice2
{
static void Main(string[] args)
{
Connectors();
Console.WriteLine("\nPress any key to continue... ");
Console.ReadKey();
}
static void Connectors()
{
//Instantiate a Presentation object with new empty PPT file
Presentation pres = new Presentation();
//Accessing a slide using its slide position
Slide slide = pres.GetSlideByPosition(1);
//Creating 4 rectangles
Aspose.Slides.Rectangle root = CreateRectangle(slide, 500, 500, 2760, 500, "Connectors");
Aspose.Slides.Rectangle straight = CreateRectangle(slide, 200, 3500, 2000, 400, "Straight");
Aspose.Slides.Rectangle elbow = CreateRectangle(slide, 3500, 1500, 2000, 400, "Elbow");
Aspose.Slides.Rectangle curve = CreateRectangle(slide, 3000, 2500, 2000, 400, "Curve");
//Create straight connector
CreateConnector(slide, ConnectorType.Straight, root, 2, straight, 0);
//Create elbow connector
CreateConnector(slide, ConnectorType.Elbow, root, 3, elbow, 0);
//Create curve connector
CreateConnector(slide, ConnectorType.Curve, root, 2, curve, 1);
//Write presentation on disk
pres.Write( "c:\\outConnectors.ppt");
}
//Used by Connectors()
static Aspose.Slides.Rectangle CreateRectangle(Slide slide, int x, int y, int w, int h, string text)
{
// Create new Rectangle shape on a slide
Aspose.Slides.Rectangle rectangle = slide.Shapes.AddRectangle(x, y, w, h);
// Set format of lines for the rectangle
rectangle.LineFormat.Width = 5;
rectangle.LineFormat.ForeColor = Color.Red;
// Add centered text
rectangle.AddTextFrame(text);
TextFrame tf = rectangle.TextFrame;
tf.Paragraphs[0].Alignment = TextAlignment.Center;
tf.Paragraphs[0].Portions[0].FontBold = true;
tf.Paragraphs[0].Portions[0].FontHeight = 36;
// Return created shape
return rectangle;
}
//Used by Connectors()
static Connector CreateConnector(Slide slide, ConnectorType type,
Shape shape1, int connPoint1,
Shape shape2, int connPoint2)
{
// Add new connector with some random default coordinates
Connector connector = slide.Shapes.AddConnector(
type, new Point(500, 500), new Point(1000, 1000));
// Connect connector with 2 shapes
connector.ConnectBegin(shape1, connPoint1);
connector.ConnectEnd(shape2, connPoint2);
// Set connector style
connector.LineFormat.ForeColor = Color.Blue;
connector.LineFormat.Width = 5;
connector.LineFormat.EndArrowheadStyle = LineArrowheadStyle.Open;
// Return created connector
return connector;
}
}
}
------------------------------------------------------------------------------------------------
Many Thanks and Kind Regards, Shakeel Faiz Support Engineer Aspose Tyumen Team
|
|
-
05-10-2008, 1:39 AM |
-
mosfiqur
-
-
-
Joined on 08-01-2007
-
-
Posts 17
-
-
-
-
|
Dear Shakeel,
I checked your attached "outConnectors.ppt", but it's with the same problem I mentioned.
If you move the first reactangle (named "Connectors") then the connectors attached with the shape don't move with it. But connectors' behavior should be to move with the corresponding Shape.
The connector's behaviour is correct for the remaining shapes. (Connectors move with the connected shape)
I checked with different autoshapes with different combination of connectors. But some connectors behave properly and some don't. Please help with a reply immediately whether you have any fix for this problem.
|
|
-
05-10-2008, 7:32 PM |
-
msfaiz
-
-
-
Joined on 02-01-2007
-
-
Posts 2,275
-
-
-
-
|
Re: Connector Issue
Attachment: Present (inaccessible)
Can you please provide some code example, which reproduces this problem? I have moved the rectangle namely Connectors but it moves the connector lines along with it as you can see in screenshots. Which version of MS-PowerPoint you are using? I checked it in 2002
Many Thanks and Kind Regards, Shakeel Faiz Support Engineer Aspose Tyumen Team
|
|
-
05-11-2008, 12:39 AM |
-
mosfiqur
-
-
-
Joined on 08-01-2007
-
-
Posts 17
-
-
-
-
|
Dear Shakeel, So thanks for quick reply. The problem is with MS-Powerpoint 2007.
I have checked the slide with MS-Powerpoint 2003 and found OK as you mentioned. But we need to support all the versions of powerpoint. Do we need to code for version 2007 seperately? Then please provide the related code.
Waiting for your response.
|
|
-
-
05-13-2008, 11:37 PM |
-
mosfiqur
-
-
-
Joined on 08-01-2007
-
-
Posts 17
-
-
-
-
|
Another problem related to Connector. Is there any way to define the path of a connector?
|
|
-
05-15-2008, 1:44 AM |
-
mosfiqur
-
-
-
Joined on 08-01-2007
-
-
Posts 17
-
-
-
-
|
Re: Connector Issue
Attachment: Present (inaccessible)
I have attached two images showing different paths of the same connector.
Please provide the related code to do this.
|
|
-
05-20-2008, 1:01 AM |
-
mosfiqur
-
-
-
Joined on 08-01-2007
-
-
Posts 17
-
-
-
-
|
We are waiting for your suggestion related to control the route of any connector. Please let me know whether the issue requires more explanation.
|
|
-
05-20-2008, 7:21 PM |
-
msfaiz
-
-
-
Joined on 02-01-2007
-
-
Posts 2,275
-
-
-
-
|
Dear Mosfiqur,
The issue does not require further explanation, I have requested technical team to help you know how to control the route of connectors or if it is possible with Aspose.Slides. Please wait, it will help you as soon as possible.
Many Thanks and Kind Regards, Shakeel Faiz Support Engineer Aspose Tyumen Team
|
|
-
05-21-2008, 12:21 AM |
-
mosfiqur
-
-
-
Joined on 08-01-2007
-
-
Posts 17
-
-
-
-
|
Dear Shakeel Faiz,
Thanks for you kind help. We're already in pressure to meet deadline of our project relating Aspose.Slide issues. We're almost there of our solution and implementation of Aspose.Slide in our web project except the pending issue which is very important to meet requirements in the project. We're going to buy a new license of Aspose.Slide ver 2.8 as soon as we got our issues solved.
Thanks again.
Mosfiqur
|
|
-
06-04-2008, 5:26 AM |
-
mosfiqur
-
-
-
Joined on 08-01-2007
-
-
Posts 17
-
-
-
-
|
Re: Connector Issue
Attachment: Present (inaccessible)
Dear Shakeel, Another issue related to connector. - We are using a template slide(attached here), containing 1 rectangle and 2 autoshapes. Our purpose is to use the shapes as template, draw as many as required(copy corresponding memorystream and use Shapes.Add(stream)) and connect them with Aspose connector as required, to prepare our slides. The reason for using the template shapes is, as Aspose has only option to draw them as PolyLine, and Aspose.Connector doesnt support (ConnectionSitesRaw.Length is 0 for the shapes drawn as PolyLine) connecting Shapes drawn as PolyLine.
- This works fine. (sample code attached). But we are to change the default shape of the autoshapes in PowerPoint ( Format -> ConvertToFreedom -> Edit Points). If the shape named, "DISREGARDED" is converted to freedom, the code still works.
- But if the autoshape named "THIRDPARTY" is converted to freedom, then slide.Shapes.AddConnector() method throws exception "An unhandled exception of type 'System.ApplicationException' occurred in Aspose.Slides.dll, Additional information: Autoshape haven't calculation data"
- Please provide the solve.
- Have you any better solution for our whole problem?
|
|
|
|