Sign In  Sign Up Live-Chat

Formatting lost while cloning

Last post 09-05-2008, 11:06 AM by NarrySharma. 10 replies.
Sort Posts: Previous Next
  •  08-28-2008, 9:24 AM 141639

    Formatting lost while cloning

    Hi,

    I am trying to clone slides from Ppt to other ppt using

    fromPpt.cloneSlide(srcSld, slidePosition, toPpt, treeMap);

    However the master slide in the toPpt lost the formatting.

    Please assist.

    Thanks.

     
  •  08-28-2008, 11:35 PM 141715 in reply to 141639

    Re: Formatting lost while cloning

    Hello,

    Most probably, you are missing the correct order of presentations, when cloneSlide is used. Or you might be using the already used TreeMap object.

    Suppose, you want to clone sourceSlide from sourcePresntation to destinationPresentation, so it will look like this

    sourcePresentation.cloneSlide(sourceSlide, 1, destinationPresentation, new TreeMap());

    For more information, you should see this link.

    http://www.aspose.com/documentation/file-format-components/aspose.slides-for-.net-and-java/cloning-a-slide.html


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  08-29-2008, 10:39 AM 141780 in reply to 141715

    Re: Formatting lost while cloning

    Attachment: Present (inaccessible)

    Hello Aspose team., thanks for the support.

    Cloning worked fine for all the ppts and using the documentation you mentioned.

    It just fails for the attached presentation , can you please assist if anything is wrong with the source.ppt or any formatting not supported by aspose.

    Thanks again.

     
  •  08-31-2008, 2:00 PM 141865 in reply to 141780

    Re: Formatting lost while cloning

    This is because of different slide sizes. You need to add this line of code to make slide sizes equal in both presentations

     

    e.g

    //Make the slide size of destination equals to source

    destination.setSlideSize(source.getSlideSize());

     

    A complete code example is given below.

     

    Presentation source=new Presentation(new FileInputStream("d:\\downloads\\source.ppt"));

    Presentation destination=new Presentation();

     

    //Make the slide size of destination equals to source

    destination.setSlideSize(source.getSlideSize());

     

    int sourceLastSlidePosition=source.getSlides().getLastSlidePosition();

    int destinationLastSlidePosition=source.getSlides().getLastSlidePosition();

     

    for(int i=1; i<=sourceLastSlidePosition; i++ )

    {

          Slide sourceSlide=source.getSlideByPosition(i);

         

          source.cloneSlide(sourceSlide, destinationLastSlidePosition+1, destination, new TreeMap());

         

          destinationLastSlidePosition++;

    }

     

    destination.write(new FileOutputStream("c:\\out.ppt"));


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  09-02-2008, 3:41 PM 142091 in reply to 141865

    Re: Formatting lost while cloning

    Thanks a lot ! It solved our problem.

    Not sure if I can add the below finding to the same thread:

    1) I found that my header text and other attributes like headerVisible, footerVisible are not getting copied while cloning. Do I need to set these explicitly from source to destination slide. 

    2) My next thought would be : what all do we need to take care of while cloning slides that are not automatically cloned or copied.

    Thanks team for your continued support!

     
  •  09-02-2008, 4:37 PM 142098 in reply to 142091

    Re: Formatting lost while cloning

    1-     Please provide source ppt to reproduce it.

    2-     You don’t need any extra step, cloneslide will take care of everything.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  09-02-2008, 6:36 PM 142106 in reply to 142098

    Re: Formatting lost while cloning

    Attachment: Present (inaccessible)
    Attached is the ppt which has a footer but the cloned one did not get the footer text.
     
  •  09-03-2008, 5:22 PM 142272 in reply to 142106

    Re: Formatting lost while cloning

    Hello,

     

    I was wrong; you need to set header footer properties visible in order to display them. For example, in the above code, you will do the following change to make page number visible.

     

    Slide dstSld=source.cloneSlide(sourceSlide, destinationLastSlidePosition+1, destination, new TreeMap());

    dstSld.getHeaderFooter().setPageNumberVisible(true)


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  09-03-2008, 6:51 PM 142278 in reply to 142272

    Re: Formatting lost while cloning

    Thank you for the clarification.

    From your experience - would you suggest anything else that need to be taken care off explicitly while cloning (like we have done for header properties) ?

     
  •  09-04-2008, 5:13 AM 142345 in reply to 142278

    Re: Formatting lost while cloning

    I think, no other things are required.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  09-05-2008, 11:06 AM 142621 in reply to 142345

    Re: Formatting lost while cloning

    Okay Thank you !!

     
View as RSS news feed in XML