Page 1 of 1

How to copy an Image from another .PPTX file?

PostPosted: Sat Jan 28, 2012 12:13 pm
by insomnion
Hi,

I need to merge several PPTX files into a single presentation.
I've already created a class which performs merging of slides with simple content, but I don't know how to copy images.

When I use XmlUtils.deepCopy() to copy a slide with images, new slide requires RelationshipsPart which does not exist.
How can I copy the RelationshipsPart from the source presentation, and assign it to the new slide in the destination PPTX file?

Thanks,
Dmitriy

Re: How to copy an Image from another .PPTX file?

PostPosted: Sat Jan 28, 2012 3:52 pm
by insomnion
Ok, I've solved this problem - I copy BinaryPartAbstractImage parts using Part.addTargetPart().
It works fine, but there's another problem - in the final PPTX Presentation Image1 is displaying in place of Image2, and vice versa.

Is there any image ordering?

Thanks,
Dmitriy

Re: How to copy an Image from another .PPTX file?

PostPosted: Wed Feb 01, 2012 7:18 pm
by jason
addTargetPart returns a relationship.

You need to use the relId contained in that in your image.

Re: How to copy an Image from another .PPTX file?

PostPosted: Tue Feb 07, 2012 3:08 pm
by insomnion
Thank, Jason, it works fine.

Re: How to copy an Image from another .PPTX file?

PostPosted: Thu Apr 10, 2014 2:02 am
by rushabh
Hi insomnion,
I am also stucked at the same point as you were.
I am able to copy all contents from source PPTX file to destination PPTX file, but while coping image I am having same issue as you had.
Please help me.