Sign In  Sign Up Live-Chat

Connector Issue

Last post 06-04-2008, 5:26 AM by mosfiqur. 11 replies.
Sort Posts: Previous Next
  •  05-06-2008, 5:33 AM 125581

    Connector Issue

    Hi,

    I tried the sample code to create connector in slide ( http://www.aspose.com/documentation/file-format-components/aspose.slides-for-.net-and-java/creating-connectors.html ) between two shapes. But it connects only with the second shape and the first shape remains disconnected from the connector!!!!

    Can any one help me on this?

    Thanks.

    Mosfiqur Rahman

     
  •  05-07-2008, 5:45 AM 125781 in reply to 125581

    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 126369 in reply to 125781

    Re: Connector Issue

    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 126399 in reply to 126369

    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 126400 in reply to 126399

    Re: Connector Issue

    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-11-2008, 5:55 PM 126409 in reply to 126400

    Re: Connector Issue

    We will investigate and fix it as soon as possible.
    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  05-13-2008, 11:37 PM 126817 in reply to 126409

    Re: Connector Issue

    Another problem related to Connector.
    Is there any way to define the path of a connector?

     
  •  05-15-2008, 1:44 AM 127095 in reply to 126817

    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 127785 in reply to 127095

    Re: Connector Issue

    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 127927 in reply to 127785

    Re: Connector Issue

    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 127956 in reply to 127927

    Re: Connector Issue

    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 129982 in reply to 127956

    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"
    1. Please provide the solve.
    2. Have you any better solution for our whole problem?
     
View as RSS news feed in XML