I find out that I can get font information by searching for each Run object in a document. My code:
NodeCollection<Run> runs = document.getChildNodes(NodeType.RUN, true);
for (Run run : runs) {
System.out.println("color: " + run.getFont().getColor());
System.out.println("size: " + run.getFont().getSize());
}
Using this approach, I can get font information of a Run object, which should be part of a paragraph. But how can I get the font information for each word/span in the paragraph?
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.