Junk values in case of UnOrdered List :

Hi ,

Im using Aspose(java) to convert Document to Html.

I imported a document that contains unordered list like tick mark bullets ,diamond bullets list etc … after converting into HTML .I am seeing junk values in the place of UnOrdered list .I attached sample document with this .

Is it possible to handle this problem ??

Thanks,
Anbu Chezhian.S

Hi

Thanks for your inquiry. I cannot reproduce the problem on my side. I attached HTML document produced by the following code:

Document doc = new Document(“C:\Temp\listing.doc”);

doc.save(“C:\Temp\out.html”, SaveFormat.HTML);

I use latest version Aspose.Words for Java (3.1.1.1). You can download it from here

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

Best regards,

Hi ,

I am getting same output even from your html .I attached snapshot of output . I am using Firefox 3.0.10 version.Even i tried in Firefox 3.5 ,but am getting same result

Regards,

Anbu Chezhian.S

Hi

Thank you for additional information. The problem might because Wingdings font is used for bullets characters, and this font is not installed on your PC. I have attached Wingdings fonts. Please try installing them and let me know how it goes.

Best regards.

Hi ,
I already have ‘WingDing’ fonts in my system.But its still not displaying properly. I learned that FireFox could not display ‘Wingdings’ fonts properly as it has a bug in it.Inorder to display it in FireFox ver 2,i found a solution (http://nothing.golddave.com/?p=53) but it wont work in FireFox newer version .FireFox may fix this bug later ,if so i cannot inform this to every user .
In case of Aspose version 2 ,By default it displays bullet list even though document contains other unordered list like (‘Tick list’,‘Star list’,etc … ).But in latest version ,it showing junk values in FireFox (as i said earlier that it has bug in it )and display properly in Internet Explorer (IE).Aspose didnt handled properly to support all browser.
I need to display them properly in all browser . Atleast i need to display bullet list in case of unordered list like (‘Tick list’,‘Star list’,etc … ).
Can you able to give seperate patch that fix this issue ?
Do help me.Its urgent

Regards,
Anbu Chezhian.S

Hi Anbu,

Thank you for additional information. I managed to reproduce the problem in FireFox, moreover when save your document as HTML using MS Word, the HTML has the same problem in FireFox.

We will consider adding an option, which will allow controlling how list are output into HTML. You will be notified as soon as the issue is resolved.

IF you need, we can try to find a programmatic workaround of this issue.

Best regards.

Hi ,
Thanks for the consideration. Can you explain the
“programmatical workaround” to this solution. Are you talking about
showing proper list even in firefox borwsers?

Any kind of “Quick” workaround is appreciated…

Thanks in advance

Regards,
Anbu Chezhian.S

Hi

Thanks for your request. As a workaround, you can reset formatting of your bulleted lists. If it is acceptable for you to use default bullet, then you can try using the following code:

// Open document.

Document doc = new Document(“C:\Temp\listing.doc”);

// Get all paragrphs in the document

NodeCollection paragraphs = doc.getChildNodes(NodeType.PARAGRAPH, true);

// Loop through all paragraphs.

for (int i = 0; i < paragraphs.getCount(); i++)

{

Paragraph par = (Paragraph)paragraphs.get(i);

// Check if paragraph is list item.

if (par.isListItem() && par.getListFormat().getListLevel().getNumberStyle() == NumberStyle.BULLET)

{

// Reset list formating.

int level = par.getListFormat().getListLevelNumber();

par.getListFormat().applyBulletDefault();

par.getListFormat().setListLevelNumber(level);

}

}

// Save output as HTML.

doc.save(“C:\Temp\out.html”, SaveFormat.HTML);

Hope this helps.

Best regards.

Hi ,
Thanks a lot .Its working well. I can live with this temporarily (not too long though ;)).

I believe the fix for showing proper list (check list, start list etc) in all the browsers will be available in the next update soon.

Hi ,
I am facing a problem from the given code . I converted Doc [ containing unordered list ] to html using this code,if i convert that HTML to DOC again am getting an extra blank line for every list in converted Document .I found from HTML that ,it creating a UL node for every list value. Hence am getting a blank line in Document .

For ex : If i have a list like

  • List 1
  • List 2

Instead of getting

  • List1

  • List2

Im getting :
-------------------------------------------------------

    List1

    List2

Hence am getting a blank line while exporting this HTML to Doc .
What i have to do now.Do help me .

Thanks in advance

Hello!

Thank you for asking this.

Please attach the source file reproducing this case. Most probably it happens because those two list items really belong to different lists. You can check this by selecting any of list labels in Microsoft Word. Only if another one is also selected then they are in one list. Aspose.Words doesn’t export paragraphs from different lists as if they were in one, even equally formatted.

Regards,

Hi Klepus,Thanks for the reply. I attached the Doc with this post. Its coming for all documents that contain unordered list.
Help me .

Thanks in advance

Hi

Thank you for additional information. Viktor is right, the problem occurs because each list item belong to the separate list. Please try using the following code to resolve the issue:

Document doc = new Document(“C:\Temp\anbuList.doc”);

NodeCollection paragraphs = doc.getChildNodes(NodeType.PARAGRAPH, true);

List newList = null;

List oldList = null;

for (int i = 0; i < paragraphs.getCount(); i++)

{

Paragraph par = (Paragraph)paragraphs.get(i);

if (par.isListItem() && par.getListFormat().getListLevel().getNumberStyle() == NumberStyle.BULLET)

{

int level = par.getListFormat().getListLevelNumber();

if (par.getListFormat().getList().equals(oldList) && newList != null)

{

par.getListFormat().setList(newList);

}

else

{

oldList = par.getListFormat().getList();

par.getListFormat().applyBulletDefault();

newList = par.getListFormat().getList();

}

par.getListFormat().setListLevelNumber(level);

}

}

doc.save(“C:\Temp\out.html”, SaveFormat.HTML);

Hope this helps.

Best regards.

The issues you have found earlier (filed as WORDSNET-1170) have been fixed in this .NET update and this Java update.


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