Hi,
I need some clarifications on retrieval of font size for following styles: “Heading 1” and “TOC Heading”.
If we load the document and print the font size for styles specified above, we get 14.0 but if we open the document in MS Word UI then font size for these styles come out as 16.0.
I am confused why we are seeing different values for font size with Aspose APIs and MS Word UI.
The code is given below:
public void testHeading1() throws Exception {Document sample =new Document(“MSBlank.docx”);if (sample.getStyles().get(“Heading 1”) == null) {System.out.println(“Heading 1 not present in sample”);} else {System.out.println("Style name: "+“Heading 1”);System.out.println("Font Name: "+sample.getStyles().get(“Heading 1”).getFont().getName());System.out.println("Font Size: "+sample.getStyles().get(“Heading 1”).getFont().getSize());}if (sample.getStyles().get(“TOC Heading”) == null) {System.out.println(“TOC Heading not present in sample”);} else {System.out.println("Style name: "+“TOC Heading”);System.out.println("Font Name: "+sample.getStyles().get(“TOC Heading”).getFont().getName());System.out.println("Font Size: "+sample.getStyles().get(“TOC Heading”).getFont().getSize());}}
Style name: Heading 1Font Name: CambriaFont Size: 14.0Style name: TOC HeadingFont Name: CambriaFont Size: 14.0
The MS Word UI for both styles is attached as snapshots. If you look into these snapshots, you will observe that font size for both styles is 16.0
The sample document is attached with this post.
Please look into this issue as soon as possible.
Thanks
Manisha