You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by kranthi reddy <kr...@gmail.com> on 2012/01/10 10:19:01 UTC

Default Font Size in docx files

Hi all,

    I am trying to find what is the default font size for a given document.
In .docx, when i try to print fontsize using the function getFontSize() in
XWPFRun class, I get -1 or some value. It looks like unless the user has
specially mentioned the font size while creating the document, this
information isn't stored in the XML files of docx and hence returning -1.

    Can some one please guide me in finding the default font size of the
document and how to retrieve it, so that I can understand the when
getFontSize() returns "-1" it refers to the default font size of the
document.

Regards,
Kranthi Reddy. B

Re: Default Font Size in docx files

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
Do not know if I am absolutely correct in this or not but much of the
information I have seen suggests that this will not be possible. Put simply,
if the font size is not explicitly specified then Word will apply it's
defaults and, of course, you have no way of discovering what these might be
from the file. The hints I have found suggest that the whole operation
revolves around the templates that are used to create the file - remember
that normal.dotx is likely to be used even if the user does not specify a
template themselves. So, when the file is opened using Word, that
installations normal.dotx will be interrogated and used if no absolute
values are supplied.

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Default-Font-Size-in-docx-files-tp5133720p5582225.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Default Font Size in docx files

Posted by sreejith2904 <sr...@gmail.com>.
hi,

   I am facing this same problem now. Can anyone help me to figure out a way
to find the actual default font size?

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Default-Font-Size-in-docx-files-tp5133720p5582062.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org