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

Free Support Forum - aspose.com

Re: Run background

Hi, can you look at following code:

Document document = new Document(inputStream);

List paragraphs = getParagraphs(document);

Paragraph paragraph = paragraphs.get(1);

.getBackgroundPatternColor().toString()); // java.awt.Color[r=0,g=0,b=0]

.getForegroundPatternColor().toString()); // java.awt.Color[r=0,g=0,b=0]

It should return some color or I am doing something wrong?
You have example document in the attachment.

Thanks, Ivica.


Thanks for your inquiry. This is not Paragraphs background color but it is Font.Shading.BackgroundPatternColor. See the following link for more information.

Hope this helps.

Also here is code example:

//Open the document
Document doc = new Document("C:\\Temp\\in.doc");
//Get collection of Runs
NodeCollection runs = doc.getChildNodes(NodeType.RUN, true);
//Loop though all runs
for (int i = 0; i < runs.getCount(); i++)
    Run currentRun = (Run)runs.get(i);
    //Get shading color

Best regards.