- Code: Select all
<a href="http://example.com/resource/RESOURCEID">RESOURCEID</a>
in it. I'm not sure why but when I import the xhtml document using the import tool, it converts these urls to lowercase (which my server does not recognize). I need to preserve the original url after docx conversion. Can someone please tell me what I am doing wrong? here is my code:
- Code: Select all
String xhtml = "<html><body>Click your url here <a href=\"http://example.com/resource/RESOURCEID\">RESOURCEID</a></body></html>";
ByteArrayOutputStream baos= new ByteArrayOutputStream();
WordprocessingMLPackage doc =WordprocessingMLPackage.createPackage();
XHTMLImporterImpl xhtmlImporter = new XHTMLImporterImpl(doc);
xhtmlImporter.setHyperlinkStyle("Hyperlink");
doc.getMainDocumentPart().getContent().addAll(
xhtmlImporter.convert(xhtml,
RestUtils.getBaseUrl()) );
doc.save(baos);