Changing Background Color Dynamically
Leave feedback
You can set text background color for document contents dynamically using backColor tags.
NoteThe example reads the shop data described in The Business Layer.
import json
from groupdocs.assembly import DataSourceInfo, DocumentAssembler
with open("orders.json", encoding="utf-8") as f:
orders = json.load(f)
assembler = DocumentAssembler()
assembler.assemble_document("background-color.docx", "background-color-report.docx", [
DataSourceInfo(orders, "orders"),
DataSourceInfo("Coral", "color"),
])
The following sample file is used in this example: background-color.docx
The following sample file is used in this example: orders.json
Binary file (DOCX, 11 KB)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.