

In the "Background Color" section, you can set or change any color you want.If you want to change the background color, you can click the " Edit" icon. If you want to add new background color, you need to tap the " Add" button.Next, click on the " Background" button from the top panel. Now click on the " Page Tool" icon on the left side of the panel.Open your PDF file in the UPDF program by clicking "Open File". First, make sure you have downloaded and installed the UPDF application.Let's take a look at how to change the background color using UPDF:


If you want to change to other styles rather than shading, I think that should do the trick, too. I don't know if this method works for you, hope this helps. # Set the font size - this is important! Without this step the Put every thing together: from docx import Document Of course, you need to save the output to a file: # Save document At this point, you can create another XML element for that like above, but I did the following: # This is the tricky partĪfter the second print out command, it will output: įinally, you need to append the element to (shd) In the print out command, it will output: Ĭustom background colour (a.k.a shading, done with the paint bucket tool)īut there is still no element. Txt = 'Custom background colour (a.k.a shading, done with the paint bucket tool)'

Those modules are essential because you need to access the "XML version" of the run object, and add a element, which will set the shading, under. I had the same problem, but I found a trick to do what you are asking.įirst, you need to import these three modules: from docx.shared import Pt
