def _make_border_dict(width, style, dash_array=None): border = PdfDict( Type=PdfName('Border'), W=width, S=PdfName(style), ) if dash_array: if style != 'D': raise ValueError('Dash array only applies to dashed borders!') border.D = dash_array return border