I am using ReportLab in Python to create a fillable PDF. My problem is with the color of the fillable textboxes when printed. I'm trying to re-create a PDF using Python where the background of the textbox is colored, but when it's printed the background color of the textbox is white. I am currently using the code;
form.textfield(name=n,tooltip='',x=xpos, y=h-ypos,height=ht,width=w,fontSize=8,fontName='Helvetica',borderStyle='underlined')
Which works perfectly well other than the color stays blue when I print. I am trying to control the color, but I can't find the command. VisualStudioCode shows form.textfield has arguments 'fillColor', 'textColor', and 'borderColor', but it doesn't tell me what options it accepts, ie, hex, or RGB, or just 'red'. I've tried several but can't get one to work.
VS shows
fillColor: Any | None = None,
borderColor: Any | None = None,
textColor: Any | None = None,
but I'm not sure how to get information out of this.
Preferrably I'd like the background color turn white when printing, and the color when typing isn't completely relevant, but if I can turn it white while printing and typing that would work.
Same problem with checkboxes.
You must must use the Color class.
from reportlab.lib.colors import Color
form.textfield(
name=n,
tooltip='',
x=xpos,
y=h-ypos,
height=ht,
width=w,
fontSize=8,
fontName='Helvetica',
borderStyle='underlined',
fillColor=Color(1,1,1,0)
)