Font size get change when using InsertHTML


#1

Hi,

Font size is automatically getting changed when using InsertHTML. Is there any way to avoid this.

Regards,

I.Prabhaharan.


#2

Thanks for reporting.

Please send us the related files and the code sufficient to reproduce the problem.

Regards,


#3

This is due to the fact the the Font Size attribute of the HTML FONT tag uses a different font scale than a standard text document (e.g. Word doc). This post is written in an html font size of 3, whereas in Word this would be about a font size of 12.

Could Aspose somehow convert the Word font size to an HTML font size (and vice versa)?

E.g.:

....

....
This html font tag would produce the equivalent of a Word doc's size 12 font when used with the InsertHtml function.


#4

Hi,

Thanks for reply. I always need font size 10 with times new roman font. If they specified font name and size in font tag then also i need to change to times new roman with size 10. How can i achive this in Aspose.Words and Aspose.PDF.

Is there any way using which i can specificy the whole document font name as Times new roman and font size 10.

I need solution for both Aspose.Words and Aspose.PDF.

Regards,

I.Prabhaharan.


#5

You can use the following code to set font name and size for all text runs in the document:

foreach (Run run in doc.GetChildNodes(NodeType.Run, true))

{

run.Font.Name = "Times New Roman";

run.Font.Size = 10;

}