poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eliot Kimber <ekim...@contrext.com>
Subject Re: How to Add Notes To XSLFSlide?
Date Sat, 04 May 2019 15:44:39 GMT
OK, here's my solution, using XMLSlideShow#getNotesSlide(XSLFSlide slide), which works but
feels a bit kludgy, so maybe I'm missing a better way to get the appropriate placeholder from
the XSLFNotes object?

      List<XSLFShape> shapes = pptxNotes.getShapes();
      XSLFTextShape shape = null;
      for (XSLFShape cand : shapes) {
        String shapeName = cand.getShapeName();
        if (shapeName.startsWith("Notes Placeholder")) {
          shape = (XSLFTextShape)cand;
          break;
        }
      }

I can then add paragraphs to the shape using my normal paragraph-adding code.

Cheers,

E.
--
Eliot Kimber
http://contrext.com
 

On 5/4/19, 10:11 AM, "Eliot Kimber" <ekimber@contrext.com> wrote:

    I may have spoken too soon--looks like I'm actually getting the notes for the slide I'm
constructing but the paragraphs I'm adding are not in the right place or don't have the right
properties (they don't show up when I view the PPTX in PowerPoint but they are in the slide
note XML).
    
    So looks like it's just my user error, which is good.
    
    Cheers,
    
    E.
    --
    Eliot Kimber
    http://contrext.com
     
    
    On 5/4/19, 9:58 AM, "Eliot Kimber" <ekimber@contrext.com> wrote:
    
        getNotesSlide() does get me an XSLFNotes instance and I can then add content to it,
but as Andreas points out, addNotes() is a no-op (
        
        I'll see if I can puzzle out what's involved in adding the notes object to a slide.
        
        Cheers,
        
        E.
        
        --
        Eliot Kimber
        http://contrext.com
         
        
        On 5/2/19, 3:23 PM, "pj.fanning" <fanningpj@yahoo.com> wrote:
        
            Have you tried XMLSlideShow#getNotesSlide(XSLFSlide slide)?
            
            
            
            --
            Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html
            
            ---------------------------------------------------------------------
            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
        
        
        
    
    
    
    ---------------------------------------------------------------------
    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


Mime
View raw message