You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Katie Bell <ka...@katharos.id.au> on 2009/10/29 07:52:59 UTC

Using OPCPackage with pptx files.

Hi all,

I am having issues using the XSLFSlideShow class, when I try to
retrieve the list of relationships from a slide PackagePart, I am only
getting the slide layout relationships.

There should be image and notes relationships as well, I've tried this
with my own code as well as using the (mispelling is correct)
XSLFSlideShow.getNodesPart(...) function. I am certain that the notes
are present in the file, since i've inspected the files.

Same behavior is happening with every pptx file, the layout
relationships are parsed, but the notes relationships are entirely
absent.

e.g. On a slide which has both notes and image relationships:

      for (PackageRelationship rel : slidePart.getRelationships()) {
        System.out.println(rel.getRelationshipType());
        System.out.println(rel.getTargetURI());
      }

will print out:
http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout
/ppt/slideLayouts/slideLayout2.xml

I'm using version 3.5. Is this fixed/working in a later version?

I am happy to go digging through the code myself, I would just like
some theories/ideas/pointers to get me started.
 - Katie

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Using OPCPackage with pptx files.

Posted by Katie Bell <ka...@katharos.id.au>.
Oh holy crap.
I am *such* and idiot.

Spot the bug:
    for (int i=0; i < deck.getSlideCount(); i++) {
      Slide slide = deck.getSlide(1);
    }

How the heck did I miss that?!
I was looking at the wrong slide the whole time, slide[1] has no notes
and no images, hence I was thinking that none of the slides were
returning notes or images. It turns out it's working perfectly.

Thank you POI team! I'm sorry I doubted you. :)
 - Katie


On Fri, Oct 30, 2009 at 9:05 AM, Katie Bell <ka...@katharos.id.au> wrote:
> Ah, but I already checked the _rels files for the slides and the notes
> and image relationships *are* there. :(
>
> On Thu, Oct 29, 2009 at 11:06 PM, Nick Burch <ni...@torchbox.com> wrote:
>> On Thu, 29 Oct 2009, Katie Bell wrote:
>>>
>>> There should be image and notes relationships as well, I've tried this
>>> with my own code as well as using the (mispelling is correct)
>>> XSLFSlideShow.getNodesPart(...) function. I am certain that the notes are
>>> present in the file, since i've inspected the files.
>>
>> Alas I don't know where the notes are stored, but...
>>
>> I'd suggest running one of the files through unzip, and see what you have in
>> the way of _rels/ directories. For example, _rels/.rels tells you the
>> package wide relationships, and ppt/_rels/presentation.xml.rels the ones on
>> the presentation. It's possible that the relationship isn't stored quite
>> where you might expect, so you're querying the wrong thing.
>>
>> Nick
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Using OPCPackage with pptx files.

Posted by Katie Bell <ka...@katharos.id.au>.
Ah, but I already checked the _rels files for the slides and the notes
and image relationships *are* there. :(

On Thu, Oct 29, 2009 at 11:06 PM, Nick Burch <ni...@torchbox.com> wrote:
> On Thu, 29 Oct 2009, Katie Bell wrote:
>>
>> There should be image and notes relationships as well, I've tried this
>> with my own code as well as using the (mispelling is correct)
>> XSLFSlideShow.getNodesPart(...) function. I am certain that the notes are
>> present in the file, since i've inspected the files.
>
> Alas I don't know where the notes are stored, but...
>
> I'd suggest running one of the files through unzip, and see what you have in
> the way of _rels/ directories. For example, _rels/.rels tells you the
> package wide relationships, and ppt/_rels/presentation.xml.rels the ones on
> the presentation. It's possible that the relationship isn't stored quite
> where you might expect, so you're querying the wrong thing.
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Using OPCPackage with pptx files.

Posted by Nick Burch <ni...@torchbox.com>.
On Thu, 29 Oct 2009, Katie Bell wrote:
> There should be image and notes relationships as well, I've tried this 
> with my own code as well as using the (mispelling is correct) 
> XSLFSlideShow.getNodesPart(...) function. I am certain that the notes 
> are present in the file, since i've inspected the files.

Alas I don't know where the notes are stored, but...

I'd suggest running one of the files through unzip, and see what you have 
in the way of _rels/ directories. For example, _rels/.rels tells you the 
package wide relationships, and ppt/_rels/presentation.xml.rels the ones 
on the presentation. It's possible that the relationship isn't stored 
quite where you might expect, so you're querying the wrong thing.

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org