HTML Hyperlink Anchor in Hidden Content is not Clickable when Inserting in Word Document using Aspose.Words for Java

Thank you for your quick reply…

Hi Awais,
Any update on the issue ID WORDSNET-21612?

@bekal94,

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.

Hi Awais, the WORDSNET-21612 status says that the Analysis is complete. Is there any update on the same?

@bekal94,

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.

2 posts were split to a new topic: HTML to Word DOCX | Visibility of Hidden Numbered and Bullet Lists | Java

Hi Awais,

I see the status of the WORDSNET-21612 is closed… Can I know what is the fix that is applied so that I can update here as well?

@bekal94,

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.

Hi Awais,
Any update on the release of this completed issue? Please do let me know when it becomes available.

Thanks

@bekal94,

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.

The issues you have found earlier (filed as WORDSNET-21612) have been fixed in this Aspose.Words for .NET 21.5 update and this Aspose.Words for Java 21.5 update.

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.

@bekal94,

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:

  1. A regular Aspose.Words for Java 21.5 package that supports the following Java versions:
  • J2SE 7.0 (1.7)
  • J2SE 8.0 (1.8)
  • or above (for example Java 10)
  1. Aspose.Words for Java 21.5 (JDK1.6 only) package that is specially compiled for JDK1.6. You can choose this if you are using Aspose.Words for Java on an old Java 6 environment.

For any more details, please refer to following section of documentation:

Hi Awais,

  1. A regular Aspose.Words for Java 21.5 package that supports the following Java versions:
  • J2SE 7.0 (1.7)
  • 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)

@bekal94,

Please try the latest (21.6) version of Aspose.Words for Java. It should work in your OpenJDK 8 282u environment. However, we currently do not provide a JAR which is specially compiled for OpenJDK 282u.

Hi Awais,
Thanks for the latest version we are still testing the same, Meanwhile is it possible to please provide the source code or the code changes made to handle the wordsnet-21612 issue?

@bekal94,

Please see this output Word DOCX document (awjava-21.6.docx (7.6 KB)) which was produced on my end by using the following code of Aspose.Words for Java 21.6:

com.aspose.words.Document docWordAspose = new com.aspose.words.Document();
// Document builder for Aspose doc
com.aspose.words.DocumentBuilder builder = new com.aspose.words.DocumentBuilder(docWordAspose);
String strContentData = "<style>div> :first-child {display: inline}</style><div hidden style='border-style: solid;border-width: 1px;font-family:Times New Roman;font-size:11.0pt;font-weight:bold;'>RATIONALE: <p>This is content in the Rational, <a contenteditable=\"false\" href=\"https://sngfvm1df007.ap.xom.com/3dspace/xomgpt/xomGPTStdRefURLRedirector.jsp?id=569D1223000056905EF2FF6C00000209\" stdid=\"569D1223000056905EF2FF6C00000209\" stdref=\"Required References\" stdvalue=\"GOST 19281-89\" target=\"_blank\">GOST 19281-89</a> Same hyperlink is attached here.</p></div>\r\n" +
        "<style>div> :first-child {display: inline}</style><div hidden style='border-style: solid;border-width: 1px;font-family:Times New Roman;font-size:11.0pt;font-weight:bold;'>Note:<p>This is content in the Notes, <a contenteditable=\"false\" href=\"https://sngfvm1df007.ap.xom.com/3dspace/xomgpt/xomGPTStdRefURLRedirector.jsp?id=569D1223000056905EF2FF6C00000209\" stdid=\"569D1223000056905EF2FF6C00000209\" stdref=\"Required References\" stdvalue=\"GOST 19281-89\" target=\"_blank\">GOST 19281-89</a> Same hyperlink is attached here.</p>\r\n";
try {
    builder.insertHtml(strContentData);
} catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
docWordAspose.save("C:\\Temp\\Information_Repo\\awjava-21.6.docx");

Hi Awais,

While testing the JAR provided (v21.5 and 21.6) we are getting error as there is probably a mismatch in the Tomee service we are using.
Tomcat 8.5.20 / Tomee 7.0.4
ASM library version 6 (xbean-asm5-shaded-4.5)

Keeping this in mind, wanted to seek your help to understand a few questions. It would be extremely helpful if you have any answers around this.

  1. Which version of java was used for compiling this code (jar 21.5)?
  2. Which version of tomee/tomcat is supported by this jar?
  3. If there is a way to provide us jar compatible to our external tomee version.

Thanks in Advance

@bekal94,

We are working on your query and will get back to you soon.

@bekal94,

We are using Java 6 to compile jdk16 jar and Java 7 to compile jdk17. Apache should support both of them. Also, please note that the jdk17 jar passes all of our unit tests under Java 8 JRE before publishing every release.

As we understand, you are not seeing any errors with our jdk17 jar; but just observing some sort of warnings reported by your QA department. I am afraid, it is not possible for us to provide too many separate jars for jdk5, jdk6, jdk7, jdk8 and other jdk libraries which are still used by industry.