We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Get Default Font Name

Dear Team,

I am using Aspose.words.java for doc to html conversion.Is it possible to get default font-size, family, page background color from document ?

Regards,
AnbuChezhian.S

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

Thanks for your request. Unfortunately there is no way to get Background color of the document using Aspose.Words for Java. Your request has been linked to the appropriate issue. You will be notified as soon as it is supported.

Also currently there is no public API to retrieve default document properties. I have logged this as a feature request. Once this option will be implemented, I will inform you.

Also if it is acceptable for you, you can try using the following code:

// Load document

Document doc = new Document("C:\\Temp\\in.doc");

System.out.print(doc.getStyles().get("Normal").getFont().getName());

System.out.print(doc.getStyles().get("Normal").getFont().getSize());

Best regards,

Dear Andrey ,

Thanks for your reply. Is it possible to differentiate header/footer,end/footnote,comments from the document ? Actually what i need is, after converting doc to html, i need to identify the header,footer,end/footnote,comment content. Is it possible to surround header/footer,end/footnote,comments by span|div with some unique class ? Do help me.

Regards,
Anbu Chezhian.S

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

Thank you for additional information. In your case, you can try specifying CssStyleSheetType.Embedded of SaveOptions, please see the following code:

// Open document

Document doc = new Document("C:\\Temp\\in.docx");

doc.getSaveOptions().setHtmlExportCssStyleSheetType(CssStyleSheetType.EMBEDDED);

doc.save("C:\\Temp\\out.html");

After converting to HTML you can identify the header, footer, end/footnote, comment content using Class identifier:

<p class="Header">

<p class="CommentText">

<p class="FootnoteText">

Hope this helps.

Best regards,

Dear Andrey,

Thanks for your suggestion. Its working great. Thanks a lot.

Regards,
Anbu Chezhian.S

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


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

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


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