While passing Content Data into the Word file using Java, post Aspose generation of the word file, the content that is hidden does not have Hyperlinks applied to them.
So the “hidden” attribute in the div causes the rational to be hidden in the word file, the content data is getting added with no issues, but the hyperlinks are not clickable (Refer screenshot below) asposeword.PNG (183.3 KB)
Is there a styling error? or is there some way we can get the hyperlink to get updating correctly?
Please also create a standalone simple Java application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words JAR files in it to reduce the file size.
As soon as you get these pieces of information ready, we will start further investigation into your particular scenario/issue and provide you more information.
The information you have requested has been attached,
• Your simplified input Word document - There is no input word document, we are generating it from the tool. So I have attached a video for your understanding.
Please also create a standalone simple Java application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words JAR files in it to reduce the file size. – Since the source code is confidential information, I will have to try to get a customized Jar for your testing, I am still working on that.
Meanwhile please check the above and let me know if anything else is required.Information.zip (8.2 MB)
I have managed to locate and observe the issues in the output DOCX files that you shared. You are right, the hidden blue text contents in these output documents are not rendering as Hyperlink fields. But, after an initial test with the licensed latest (20.12) version of Aspose.Words for Java, I was unable to reproduce this issue on my end. I used the following simple Java code to convert your HTML to DOCX format on my end:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
String data = new String(Files.readAllBytes(Paths.get("C:\\Temp\\Information (1)\\Test.html")));
builder.insertHtml(data);
doc.save("C:\\temp\\Information (1)\\awjava-20.12.docx");
Awais, Information_Repo.zip (6.3 KB)
Sorry my bad, the HTML did not have the hidden attribute, that is why it worked.
Sharing the code and the Reproduced Document for reference.
The link is hidden so you will have to click on Show/Hide option in Word.
Thanks
We have logged this problem in our issue tracking system with ID WORDSNET-21612. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.
WORDSNET-21612 is currently pending for analysis and is in the queue. We will inform you via this forum thread as soon as this issue will get resolved in future. We apologize for any inconvenience.
Unfortunately, your issue is not resolved yet; but yes, we have completed the analysis of this issue and the root cause has been identified. Currently, Aspose.Words handles anchors if element is visible and discards when it is not. We will change this behavior and write Hyperlink for hidden references (and mimic MS Word’s logic). We will inform you via this forum thread as soon as this issue will get resolved in future and apologize for any inconvenience.
Your issue WORDSNET-21612 has now been resolved and the fix of this issue will be included in 21.5 version of Aspose.Words for Java. We will notify you here as soon as 21.5 version will be released at the start of May 2021.
I am afraid, the 21.5 release of Aspose.Words for Java is not published yet. We will notify you here as soon as we publish the next Aspose.Words for Java 21.5 release in next few days.
HI Awais,
Thank you for resolving the issue, we were able to use the jar for testing and it has fixed the hyperlink issue,
However when deploying in our QA environment we have encountered an issue where the jar is incompatible, possibly because we are using Oracle JAVA 8-181u in the QA and PROD servers.
Is it possible to provide the same jar by compiling using JAVA 8?
We also have a plan to upgrade to Adopt OpenJDK 281u later this year, So is it compatible with that as well?
Thanks in advance.
You can use the regular JAR from the latest (21.5) version of Aspose.Words for Java package. It should work in your current (and future OpenJDK 281u) environments. However, we currently do not provide a JAR which is specially compiled for OpenJDK 281u.
At the moment, we only ship two types of packages:
J2SE 8.0 (1.8) - we are currently using this version (Adopt Open JDK 8 282u)
or above (for example Java 10)
But on the Acceptance environment we see that this jar is not compatible. Please let me know if you have a jar that is complied in Java 8 (Adopt OpenJDK - 8 282u)