Package org.apache.poi.hslf.model

Examples of org.apache.poi.hslf.model.Hyperlink


                TextRun[] txt = slide[j].getTextRuns();
                for (int k = 0; k < txt.length; k++) {
                    String text = txt[k].getText();
                    Hyperlink[] links = txt[k].getHyperlinks();
                    if(links != null) for (int l = 0; l < links.length; l++) {
                        Hyperlink link = links[l];
                        String title = link.getTitle();
                        String address = link.getAddress();
                        System.out.println("  " + title);
                        System.out.println("  " + address);
                        String substring = text.substring(link.getStartIndex(), link.getEndIndex()-1);//in ppt end index is inclusive
                        System.out.println("  " + substring);
                    }
                }

                //in PowerPoint you can assign a hyperlink to a shape without text,
                //for example to a Line object. The code below demonstrates how to
                //read such hyperlinks
                System.out.println("  reading hyperlinks from the slide's shapes");
                Shape[] sh = slide[j].getShapes();
                for (int k = 0; k < sh.length; k++) {
                    Hyperlink link = sh[k].getHyperlink();
                    if(link != null)  {
                        String title = link.getTitle();
                        String address = link.getAddress();
                        System.out.println("  " + title);
                        System.out.println("  " + address);
                    }
                }
            }
View Full Code Here


                TextRun[] txt = slide[j].getTextRuns();
                for (int k = 0; k < txt.length; k++) {
                    String text = txt[k].getText();
                    Hyperlink[] links = txt[k].getHyperlinks();
                    if(links != null) for (int l = 0; l < links.length; l++) {
                        Hyperlink link = links[l];
                        String title = link.getTitle();
                        String address = link.getAddress();
                        System.out.println("  " + title);
                        System.out.println("  " + address);
                        String substring = text.substring(link.getStartIndex(), link.getEndIndex()-1);//in ppt end index is inclusive
                        System.out.println("  " + substring);
                    }
                }

                //in PowerPoint you can assign a hyperlink to a shape without text,
                //for example to a Line object. The code below demonstrates how to
                //read such hyperlinks
                System.out.println("  reading hyperlinks from the slide's shapes");
                Shape[] sh = slide[j].getShapes();
                for (int k = 0; k < sh.length; k++) {
                    Hyperlink link = sh[k].getHyperlink();
                    if(link != null)  {
                        String title = link.getTitle();
                        String address = link.getAddress();
                        System.out.println("  " + title);
                        System.out.println("  " + address);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.model.Hyperlink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.