Package com.adobe.dp.epub.ops

Examples of com.adobe.dp.epub.ops.HyperlinkElement


            + " of the second chapter's second paragraph. ");
      paragraph3.add(sb3.toString());
      body2.add(paragraph3);

      // add a link to the target paragraph in the first chapter
      HyperlinkElement a = chapter2Doc.createHyperlinkElement("a");
      a.setXRef(target.getSelfRef());
      a.add("Here is a link.");
      paragraph3.add(a);

      // embed fonts
      // NB: on non-Windows platforms you need to supply your own
      // FontLocator implementation or place fonts in ~/.epubfonts
View Full Code Here


        } else if (e instanceof TextAElement) {// is an hyperlink
            TextAElement ta = (TextAElement) e;
            String ref = ta.getAttribute("xlink:href");

            HyperlinkElement a = getCurrentResource().getDocument().createHyperlinkElement("a");
            if (ref.startsWith("#")) {// internal Link
                a.setTitle(ta.getAttribute("xlink:href"));
                getInternalLink().add(a);
            } else {
                a.setExternalHRef(ref);
            }
            dstElement.add(a);
            // a.add("ciao");
            traverse(ta.getFirstChild(), a);
            skipChildren = true;

        } else if (e instanceof TextBookmarkElement) {// is bookmark in epub can
                                                      // be used to implement
                                                      // internal link anchors
            TextBookmarkElement ta = (TextBookmarkElement) e;

            HyperlinkElement a = getCurrentResource().getDocument().createHyperlinkElement("a");
            a.setId(ta.getAttribute("text:name"));
            dstElement.add(a);
            getBookmarks().put("#" + ta.getAttribute("text:name"), a);
        } else if (e instanceof TextNoteElement) {// Is a footnote container
            addFootnote((TextNoteElement) e, dstElement);
            skipChildren = true;
View Full Code Here

        Element fn = getFootnotesResource().getDocument().createElement("div");
        fn.setClassName("fnDiv");
        getFootnotesResource().getDocument().getBody().add(fn);

        HyperlinkElement a = getCurrentResource().getDocument().createHyperlinkElement("a");
        a.setClassName("fnLink");
        a.setXRef(fn.getSelfRef());
        a.add(noteCit.getTextContent());
        dstElem.add(a);

        Element noteId = getFootnotesResource().getDocument().createHyperlinkElement("p");
        noteId.setClassName("Footnote");
        noteId.add(noteCit.getTextContent() + ")");
        fn.add(noteId);

        HyperlinkElement ar = getFootnotesResource().getDocument().createHyperlinkElement("a");
        // ar.setClassName("fnLink");
        ar.setXRef(a.getSelfRef());
        ar.add(" \u21B5");

        // fn.add(ar);
        OPSResource temp = getCurrentResource();
        setCurrentResource(getFootnotesResource());
        traverse((Node) getXpath().evaluate(".//text:note-body", e, XPathConstants.NODE), fn);
View Full Code Here

TOP

Related Classes of com.adobe.dp.epub.ops.HyperlinkElement

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.