Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Dec 16, 2022 10:16 am

Hello,
when trying to appendHtml text where is <table> tag class applied that have "width" parameter with "!important", "Unknown char" error is thrown:
Code: Select all
<style type="text/css">
  table.wrapper {
    width: 100% !important;
  }
</style>
<body>
  <div>
    <table class="wrapper"></table>
  </div>
</body>


The same issue is thrown when style with "!important" is applied directly to <table> tag:
Code: Select all
<body>
  <div>
    <table style="width: 100% !important;"></table>
  </div>
</body>


When !important is removed, everything is fine
Code: Select all
<style type="text/css">
  table.wrapper {
    width: 100%;
  }
</style>
<body>
  <div>
    <table class="wrapper"></table>
  </div>
</body>


Also if class is applied with !important to another tag, e.g. <div>, everything works fine

matus.vandak
 
Posts: 18
Joined: Fri Sep 02, 2022 10:00 pm

Mon Dec 19, 2022 10:35 am

Hi,

Thanks for your inquiry.
I tested the code you provided, but I did not reproduce your issue. Could you please provide us with the following information to help us do further investigation? You can send them to us via email ([email protected]) or attach them here. thanks for your assistance in advance.
1) the version of Spire.Doc in your project.
2) your full code and sample file that can reproduce your issue.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Dec 19, 2022 11:10 am

Hello Triste.
Thank you for your reply.

Version of spire.doc is "5.4.10"

Code is:
Code: Select all
htmlString = "<body>\n" +
         "  <div>\n" +
         "    <table style=\"width: 100% !important;\"></table>\n" +
         "  </div>\n" +
         "</body>";

Section tempSection = document.addSection();
tempSection.addParagraph().appendHTML(htmlString);
TextBodySelection selection = new TextBodySelection(tempSection.getBody(), 0, tempSection.getBody().getChildObjects().getCount() - 1, 0, 0);

TextBodyPart bodyPart = new TextBodyPart(selection);

BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
bookmarkNavigator.moveToBookmark(bookmarkName);
bookmarkNavigator.replaceBookmarkContent(bodyPart);

document.getSections().remove(tempSection);


The code throws error when executing appendHTML(htmlString) in double parser.
Code: Select all
com.spire.doc.packages.sprylt: Unknown char
   at com.spire.doc.packages.sprnas.spr┩□(DoubleParser.java:408)
   at com.spire.doc.packages.sprnas.spr↡▁(DoubleParser.java:41)
   at com.spire.doc.packages.sprmip.spr↡▁(SingleParser.java:41)
   at com.spire.doc.packages.sprdqt.spr↡▁(SingleExtensions.java:125)
   at com.spire.doc.packages.sprwov.spr‡℠(Convert.java:1418)
   at com.spire.doc.packages.sprwov.spr▊▥(Convert.java:1412)
   at com.spire.doc.packages.sprjgaa.spr∭┝—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr▆┝—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr©┝—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr◑┝—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr⅞┤—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr◑┝—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr⅞┤—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr◑┝—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr⅞┤—(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr▌‘(Unknown Source)
   at com.spire.doc.packages.sprjgaa.spr═‘(Unknown Source)
   at com.spire.doc.documents.Paragraph.appendHTML(Unknown Source)


I am running Manjaro linux with Slovak SK regional settings

matus.vandak
 
Posts: 18
Joined: Fri Sep 02, 2022 10:00 pm

Tue Dec 20, 2022 2:15 am

Hi,

Thanks for your feedback.
I tested your code and did reproduce the issue you mentioned with 5.4.10, but I also tried with our latest commercial version (Spire.Doc for Java_10.12.2), the code worked well and didn’t throw any exception. For your situation, I recommend you to use the latest version of Spire.Doc for Java (10.12.2), which contains many fixes and new features. We are willing to provide a temporary license (one month free) to help you evaluate our Spire.Doc better. If you need it, just let us know.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Tue Dec 20, 2022 7:25 am

Hello.
Thank you for your effort.

Will you apply also the fix in next free version update?

matus.vandak
 
Posts: 18
Joined: Fri Sep 02, 2022 10:00 pm

Wed Dec 21, 2022 7:12 am

Hi,

Thanks for your inquiry.
We irregularly maintain our free version. Sorry that I’m not sure when will the fix be applied to the free version.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Jan 05, 2023 3:03 pm

Hello.
We have license valid until april 2023. However, the license is for version 5.4 and the license includes updates for 1 year. But when I tried to use it with 10.12.2 I've got the evaluation watermark in generated document. How to use license with version 10.12.2? With version 5.4.10 is the license working fine.
Is there any need to update the license file?

software_globesy
 
Posts: 1
Joined: Wed Apr 27, 2022 6:16 am

Fri Jan 06, 2023 8:03 am

Dear ROMAN,

Thanks for your feedback.
We made adjustment regarding the license version. Your problem is caused by version mismatch. This is a problem on our side and it would not happen in the future. Apologize for the inconvenience caused. Our sales team just sent a new license of Spire.Doc for java to your email. Please apply the new license to remove the warning message.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1379
Joined: Tue Sep 27, 2016 1:06 am

Mon Jan 09, 2023 12:41 pm

Triste.Dai wrote:Hi,

Thanks for your feedback.
I tested your code and did reproduce the issue you mentioned with 5.4.10, but I also tried with our latest commercial version (Spire.Doc for Java_10.12.2), the code worked well and didn’t throw any exception. For your situation, I recommend you to use the latest version of Spire.Doc for Java (10.12.2), which contains many fixes and new features. We are willing to provide a temporary license (one month free) to help you evaluate our Spire.Doc better. If you need it, just let us know.

Sincerely,
Triste
E-iceblue support team


Hello Triste,
I updated the version to 10.12.2, tested it and it worked fine.
Thank you for your support.

matus.vandak
 
Posts: 18
Joined: Fri Sep 02, 2022 10:00 pm

Tue Jan 10, 2023 5:38 am

Hi,

Thanks for your feedback.
I am glad that your issue was solved. If there are any problems related to our products, just feel free to contact us.

Have a nice day!

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Doc