Part embeddedPart = sourcePart.getRelationshipsPart().getPart(rId); if (embeddedPart instanceof ImagePngPart || embeddedPart instanceof ImageGifPart
protected void addHyperlinkToDocFrag(JaxbXmlPart sourcePart, DocumentFragment docfrag, String url) throws Docx4JException { // We need to add a relationship to word/_rels/document.xml.rels // but since its external, we don't use the // usual wordMLPackage.getMainDocumentPart().addTargetPart // mechanism org.docx4j.relationships.ObjectFactory factory = new org.docx4j.relationships.ObjectFactory(); org.docx4j.relationships.Relationship rel = factory.createRelationship(); rel.setType( Namespaces.HYPERLINK ); rel.setTarget(url); rel.setTargetMode("External"); sourcePart.getRelationshipsPart().addRelationship(rel); // addRelationship sets the rel's @Id try { Document tmpDoc = XmlUtils.marshaltoW3CDomDocument( BindingHandler.getHyperlinkResolver().generateHyperlink(rel.getId(), url)); XmlUtils.treeCopy(tmpDoc.getDocumentElement(), docfrag); } catch (JAXBException e) { throw new Docx4JException(e.getMessage(), e); } }
rel.setTargetMode("External"); sourcePart.getRelationshipsPart().addRelationship(rel);
getNewPartName("/chunk", ".xml", sourcePart.getRelationshipsPart()));
Part embeddedPart = sourcePart.getRelationshipsPart().getPart(rId); if (embeddedPart instanceof ImagePngPart || embeddedPart instanceof ImageGifPart
Part embeddedPart = sourcePart.getRelationshipsPart().getPart(rId); if (embeddedPart instanceof ImagePngPart || embeddedPart instanceof ImageGifPart
protected void addHyperlinkToDocFrag(JaxbXmlPart sourcePart, DocumentFragment docfrag, String url) throws Docx4JException { // We need to add a relationship to word/_rels/document.xml.rels // but since its external, we don't use the // usual wordMLPackage.getMainDocumentPart().addTargetPart // mechanism org.docx4j.relationships.ObjectFactory factory = new org.docx4j.relationships.ObjectFactory(); org.docx4j.relationships.Relationship rel = factory.createRelationship(); rel.setType( Namespaces.HYPERLINK ); rel.setTarget(url); rel.setTargetMode("External"); sourcePart.getRelationshipsPart().addRelationship(rel); // addRelationship sets the rel's @Id try { Document tmpDoc = XmlUtils.marshaltoW3CDomDocument( BindingHandler.getHyperlinkResolver().generateHyperlink(rel.getId(), url)); XmlUtils.treeCopy(tmpDoc.getDocumentElement(), docfrag); } catch (JAXBException e) { throw new Docx4JException(e.getMessage(), e); } }
rel.setTargetMode("External"); sourcePart.getRelationshipsPart().addRelationship(rel);
getNewPartName("/chunk", ".xml", sourcePart.getRelationshipsPart()));
Part embeddedPart = sourcePart.getRelationshipsPart().getPart(rId); if (embeddedPart instanceof ImagePngPart || embeddedPart instanceof ImageGifPart