Free Support Forum - aspose.com

How to insert text with html tags at bookmarks

Hi,

I am using Aspose.words for java. My requirement is to insert html at the bookmarks and save the document. I used documentBuilder.insertHtml(argText) method for this. Most of the html tag are working fine but few tags like

    , are not working properly.
      is displaying some junk characters and is displayed as normal(it should be italic).

      Are these tags supported in Aspose.words? Where can I get the list of supported html tags ?

      Thanks,
      Nalini

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Which version of Aspose.Words for java do you use? Problem with list bullets was resolved in the latest version of Aspose.Words for java. You can download it from here:

http://www.aspose.com/community/files/51/file-format-components/aspose.words-for-.net-and-java/category1201.aspx

You can find an approximate list of what is supported in HTML import/export here:

http://www.aspose.com/community/files/51/file-format-components/aspose.words-for-.net-and-java/entry108980.aspx

But, you should note, this list could be out of date, since we are working on improving out HTML import/export modules.

Best regards.

Hi,

I have taken the latest Aspose.words for Java 3.1.1.1 and tested. The html I have used for testing is

Testing OL without Type


  1. Item 1

  2. Item 2



Testing
    Type - 1


    1. Item 1

    2. Item 2




    Testing
      Type - a


      1. Item 1

      2. Itme 2



      Testing
        Type - A


        1. Item 1

        2. Item 2



        Testing
          Type - i


          1. Item 1

          2. Item 2



          Testing
            Type - I


            1. Item 1

            2. Item 2




            The first 2 i.e., “Testing OL without Type” and "Testing
              Type - 1 " are working fine but the remaining are displaying junk characters. Attached the generated document for your reference.


              Thanks,
              Nalini

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I cannot reproduce the problem on my side. Here is code I used for testing:

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

String html = "Testing OL without Type" +

"

  1. Item 1
  2. Item 2
" +

"Testing

    Type - 1"
+

"

  1. Item 1
  2. Item 2
" +

"Testing

    Type - a"
+

"

  1. Item 1
  2. Itme 2
" +

"Testing

    Type - A"
+

"

  1. Item 1
  2. Item 2
" +

"Testing

    Type - i"
+

"

  1. Item 1
  2. Item 2
" +

"Testing

    Type - I"
+

"

  1. Item 1
  2. Item 2
";

builder.insertHtml(html);

doc.save("C:\\Temp\\out.doc", SaveFormat.DOC);

My output document is also attached. Please make sure you use Aspose.Words 3.1.1 in your application. Maybe some older version was cached.

Best regards.

Hi,

I have checked your output document. Though it is not displaying junk characters, the numberings it is showing is wrong. They are not as per the type.

The expected output should be like this:

Testing OL without Type

  1. Item 1
  2. Item 2

Testing OL Type - 1

  1. Item 1
  2. Item 2

Testing OL Type - a

  1. Item 1
  2. Itme 2

Testing OL Type - A

  1. Item 1
  2. Item 2

Testing OL Type - i

  1. Item 1
  2. Item 2

Testing OL Type - I

  1. Item 1
  2. Item 2

There is a mistake in the html that I posted earlier. It is not displaying juck characters because there is
    tag in the headings. I have removed those and tried. The junk characters are still getting displayed.

    Testing OL without Type


    1. Item 1

    2. Item 2



    Testing OL Type - 1


    1. Item 1

    2. Item 2




    Testing OL Type - a


    1. Item 1

    2. Itme 2



    Testing OL Type - A


    1. Item 1

    2. Item 2



    Testing OL Type - i


    1. Item 1

    2. Item 2



    Testing OL Type - I


    1. Item 1

    2. Item 2




    Can you please try with the above HTML once again?

    Thanks,
    Nalini

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I managed to reproduce the problem. You will be notified as soon as it is resolved.

Best regards.

The issues you have found earlier (filed as 10032) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,

I have included Aspose.Words.jdk14.jar in my application and tested. Still the same issue persits. I have uploaded the output document for your reference.


Regards,
Nalini

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. It seems you are right, I reproduced the same on Aspose.Words for Java 3.2.0 too. I reopened the issue, we will further investigate it and provide you more information. Sorry for inconvenience.

Best regards.

Hi Nalini,

Thanks for your report. I have emailed to you the fixed Aspose.Words.jdk14.jar. Please check your e-mail. And please inform me how it works for you.

Best Regards,

Thanks. It is working fine.

Regards,
Nalini

Hi Nalini,

We just published Aspose.Words for Java 3.2.1 that contains your fix. Anyone can find it on Aspose.Words download page. You don’t need to download it – the jar inside the release exactly the same.

Best Reagards,

The issues you have found earlier (filed as 10032) have been fixed in this update.