(name, x, y, width, height, value="", f_type=PdfName.Tx)
| 27 | return page |
| 28 | |
| 29 | def create_field(name, x, y, width, height, value="", f_type=PdfName.Tx): |
| 30 | annotation = PdfDict() |
| 31 | annotation.Type = PdfName.Annot |
| 32 | annotation.Subtype = PdfName.Widget |
| 33 | annotation.FT = f_type |
| 34 | annotation.Ff = 2 |
| 35 | annotation.Rect = PdfArray([x, y, x + width, y + height]) |
| 36 | annotation.T = PdfString.encode(name) |
| 37 | annotation.V = PdfString.encode(value) |
| 38 | |
| 39 | annotation.BS = PdfDict() |
| 40 | annotation.BS.W = 0 |
| 41 | |
| 42 | appearance = PdfDict() |
| 43 | appearance.Type = PdfName.XObject |
| 44 | appearance.SubType = PdfName.Form |
| 45 | appearance.FormType = 1 |
| 46 | appearance.BBox = PdfArray([0, 0, width, height]) |
| 47 | appearance.Matrix = PdfArray([1.0, 0.0, 0.0, 1.0, 0.0, 0.0]) |
| 48 | |
| 49 | return annotation |
| 50 | |
| 51 | def create_text(x, y, size, txt): |
| 52 | return f""" |
no outgoing calls
no test coverage detected